0 Replies Latest reply: Dec 21, 2012 10:18 AM by Prabhahar Sethu RSS

    QMS API - Create Task enabled with download option for specific user

      Hi All,

      Using QMS API I need to create a task with document download option for the specific users.For that i have written the following code.

      Server Version : Qlikview 11


      string QMS = "http://server:4799/QMS/Service";

      QMSClient Client = new QMSClient("BasicHttpBinding_IQMS", QMS);
      public ServiceInfo[] MyQVS;

         ServiceKeyClientMessageInspector.ServiceKey = Client.GetTimeLimitedServiceKey();
                 List<ServiceInfo> serviceList;
                  serviceList = Client.GetServices(ServiceTypes.QlikViewDistributionService).ToList();
                  Guid qdsGuid = serviceList[0].ID;
                  List<DocumentNode> sourceDocuments = Client.GetSourceDocuments(qdsGuid).ToList();

         documentTask.QDSID = qdsGuid;


                  documentTask.Document = sourceDocuments[0]; //Get first source document for this example
                  documentTask.General = new DocumentTask.TaskGeneral();
                  documentTask.General.Enabled = true;

                  documentTask.General.TaskName = "Task1";
                  documentTask.General.TaskDescription = "Creating a task via QMS API";

                  string[] arr1 = new string[] { "USER1", "USER2" };
                 
                  documentTask.Server = new DocumentTask.TaskServer();
                  documentTask.Server.Collaboration =new DocumentTask.TaskServer.TaskServerCollaboration();
                  documentTask.Server.DocumentLoading = new DocumentTask.TaskServer.TaskServerDocumentLoading();
                            
                  documentTask.Server.Access = new DocumentTask.TaskServer.TaskServerAccess();
                  documentTask.Server.Access.DownloadUsers =  arr1;

                  documentTask.Scope = DocumentTaskScope.General | DocumentTaskScope.Server;
                  Client.SaveDocumentTask(documentTask);


      When execute this code i am getting the following error

      PIX.QMSAPI.Exceptions.DataValidationException: Validation of DocumentTask object failed: TaskServerDocumentLoading.GranularDocumentLoading property cannot be null


      I am this error only when i try to use the server scope.But i dont find anything like "GranularDocumentLoading" under "TaskServerDocumentLoading".


      Please help me to solve this issue.


      Thanks in advance.

      Regds
      Prabhahar