Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reloading the document from Visual Studio C#

Hi,

      I like to know how to reload a document from Visual Studio C#. I m trying to use QMS API, but I cant seem to figure out how to do it? Can anyone please help me.... Thanks in advance.......

7 Replies
swuehl
MVP
MVP

Take a look at QMSEDX described here.

You'll also find a VS sample solution in attached to this document.

Not applicable
Author

For some task I m getting an QDSMain.Exceptions.DistributionFailedException --==> QDSMain.Exceptions.LogBucketErrorException error when i run it. What am i doing wrong here....?

swuehl
MVP
MVP

Are you able to trigger and run the task succesfully from within QMC (manually and/or by scheduler)?

Not applicable
Author

yes, i m able to trigger the task using edx.... and some document is reloading properly. For document it works, apparently no distribution is required. I get error whenever distribution is required for the document.

swuehl
MVP
MVP

Well, my question was more about wether you can succesfully execute the distribution task from QMC.

I can't really see what the issue might be with the information provided, maybe an authorization issue?

Not applicable
Author

try something like this:

using System;

using System.Linq;

using System.ServiceModel.Security;

using QMSAPIStarter.QMSAPIService;

using QMSAPIStarter.ServiceSupport;

namespace QMSAPIStarter

{

    class Program

    {

        static void Main(string[] args)

        {

            if (args.Count() != 1)

            {

                Console.WriteLine("No task name specified");

                Console.WriteLine("Exiting!");

                return;

            }

            QMSClient Client;

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

            Client = new QMSClient("BasicHttpBinding_IQMS", QMS);

            WindowsClientCredential creds = Client.ClientCredentials.Windows;

            creds.ClientCredential.UserName = "XXX";

            creds.ClientCredential.Password = "XXXXXXX";

            string key = Client.GetTimeLimitedServiceKey();

            ServiceKeyClientMessageInspector.ServiceKey = key;

            var taskName = args[0];

            var password = "XXXXXXX";

            Client.TriggerEDXTask(new Guid("00000000-0000-0000-0000-000000000000"), taskName, password, "", new string[0]);

            Console.WriteLine("Qlikview task started");

        }

    }

}

Not applicable
Author

here is the code an exefile you can trigger through SQL server job agent to trigger qlikview tasks to run