Click or drag to resize
IQMS2UpdateServices Method (DictionaryGuid, Uri, ServiceTypes)
Updates the service with the specified URLs of the specified type.

Namespace: PIX.Services.V12.Api2
Assembly: 
Syntax
ServiceUpdateStatus UpdateServices(
	Dictionary<Guid, Uri> serviceURLs,
	ServiceTypes serviceType
)

Parameters

serviceURLs
Type: System.Collections.GenericDictionaryGuid, Uri
The dictionary of the URL addresses of the service and their IDs.
serviceType
Type: PIX.QMSAPI.DataObjectsServiceTypes
The type of the service.

Return Value

Type: ServiceUpdateStatus
Status of the update.
Remarks
Security note Security Note

Requires membership of local group QlikView Management API and the role Document Folder Administrator.

Examples
The following code example uses the QMS API to add a QlikViewServer (QVS) service. If everything goes well it prints the status of the update. If anything goes wrong it prints an error message.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

C#
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using QMSAPI;

class Program
{
     static void Main(string[] args)
     {
         try
         {
            // create a QMS API client
            IQMS2 apiClient = new QMS2Client();

            //retrieve a time limited service key
            ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

            //create the QVS service and add it to the dictionary
            Dictionary<Guid, Uri> dictionary = new Dictionary<Guid, Uri>();
            dictionary.Add(Guid.NewGuid(), new Uri("qvsUriAddress"));

            //update the QVS service
            ServiceUpdateStatus status = apiClient.UpdateServices(dictionary, ServiceTypes.QlikViewServer);

            //print the status of the update          
            Console.WriteLine("Status of the update: " + status);
         }
         catch(Exception e)
         {
             Console.WriteLine("An error occured: " + e.Message);
         }
         // wait for user to press any key
         Console.ReadLine();
     }
}
See Also