Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

QlikView: Connect to QMS API with Visual Studio

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Damien_V
Support
Support

QlikView: Connect to QMS API with Visual Studio

Last Update:

Aug 3, 2021 8:03:12 AM

Updated By:

Sonja_Bauernfeind

Created date:

Aug 5, 2017 9:46:14 AM

Attachments

This article explains how to connect to the QMS API in Visual Studio.

 

Environment:

QlikView 

 

Steps:

Create a new project

Create a new project in Visual Studio (for instance a simple Console Application).

Add the QMS service reference

  1. Right-click the References node of the project in the Solution Explorer and select "Add Service Reference..."

    (If you cannot find the Solution Explorer at the right of your screen, go to "View" > "Solution Explorer" to show the pane.)

    add service reference.png

  2. Type the address to your running QlikView Management Service using port 4799
  3. Press the Go button.

    If the QlikView Server is running on another machine, make sure that the server can be reached and port 4799 is open for incoming connections.

    Port 4799 is the default port for QMSBackendWebServicePort, found in the QVManagementService.vshost.exe.config file, located in Program Files.

  4. If the service is found, QMSBackendService will appear after a few seconds.
  5. Choose a namespace for the imported types (for instance "QMSAPI").
  6. Press OK when done. 

    Add Service Reference Address and Namespace.png


 

Adding ServiceKey handling

The QMS API cannot be connected out-of-the-box. It needs the HTTP header "X-Service-Key" to be populated with a key retrieved by the QMS before any regular communication may occur.

This is achieved in .NET by adding a client MessageInspector via an EndpointBehavior attached to the QMS API client.

Attached to this article is a one-class implementation (QMSClientServiceKeySupport.cs) of this behavior, that can be reused straight away. 

Add this class to your project!

Note: Don't forget to replace "YOUR_NAMESPACE_HERE" and "YOUR_QMSAPI_NAMESPACE_HERE" by the correct namespaces.
 

Initiating Communication

First, you'll need an instance of the QMSClient class, and then you should initiate the ServiceKey management using the class QMSClientServiceKeySupport just added:

QMSClient qmsClient = new QMSClient();
QMSClientServiceKeySupport.Initiate(qmsClient);

Note: If you want your client to connect to a different URL you should use the following constructor instead:

QMSClient qmsClient = new QMSClient("BasicHttpBinding_IQMS", "http://yourmachinename:4799/QMS/Service");

*If you wish to use the newest interface - IQMS2 then use QMS2Client class for initiating communication.

Now the code is prepared to start using the API.

Important Note: The user running the code must be a member of a group called "QlikView Management API".

Simply create this group locally on the system if it's not there, and add yourself to it.
Note that you must log off / on for this change to be activated.


If you wish to connect to the QMS API using HTTPS instead of HTTP, please follow QlikView: Connecting to QMS API using HTTPS

Labels (2)
Comments
BuTbka
Creator
Creator

Hello!
Why are so many operations missed in QMS Backend Service?
For example - GetExternalProgramTaskGetLoadedDocuments
How can I use them?

BuTbka_0-1676032501376.png

 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @BuTbka 

Please post your query with as much detail as possible in the appropriate forum. We cannot provide further guidance directly in this article, and posting the correct forum will make your post visible to our large user base and our active support agents.

All the best,
Sonja 

Contributors
Version history
Last update:
‎2021-08-03 08:03 AM
Updated by: