Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikView - Management with PHP

Hi,..

Help-me please!!

How do I add licenses in QlikView with PHP.

I already have the following code running

<?php

class NTLMSoapClient extends SoapClient

{

     public $serviceKey = null;

     function __doRequest($request, $location, $action, $version, $one_way = 0)

     {

          $headers = array(

               'Method: POST',

               'Connection: Keep-Alive',

               'User-Agent: PHP-SOAP-CURL',

               'Content-Type: text/xml; charset=utf-8;',

               'SOAPAction: '.$action

          );

          //Once you have a service key

          if ($this->serviceKey)

               $headers[] = 'X-Service-Key: ' . $this->serviceKey;

          $this->__last_request_headers = $headers;

          $ch = curl_init($location);

          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

          curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

          curl_setopt($ch, CURLOPT_POST, true);

          curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

          curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

          curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);

          curl_setopt($ch, CURLOPT_USERPWD, 'domain/user:passwd');

          $response = curl_exec($ch);

          return $response;

     }

     function __getLastRequestHeaders() {

          return implode("\n", $this->__last_request_headers)."\n";

     }

}

$options = array(

     'exceptions'=>true,

     'trace'=>1

);

//Create SOAP connexion

$client = new NTLMSoapClient('http://localhost:4799/QMS/Service?WSDL', $options);

//Retrieve a time limited service key

$client->serviceKey = $client->GetTimeLimitedServiceKey()->GetTimeLimitedServiceKeyResult;

//Retrieve server info

$qlikviewServerInfo = $client->GetServices(array('serviceTypes' => 'QlikViewServer'))->GetServicesResult;

//$allDocs = $client->GetUserDocuments(array($qlikviewServerInfo->ServiceInfo->ID))->GetUserDocumentsResult;

echo 'QVS ID: ' . $qlikviewServerInfo->ServiceInfo->ID;

$allDocs = $client->GetUserDocuments(array($qlikviewServerInfo->ServiceInfo->ID))->GetServicesResult;

//echo 'QVS ID: ' . $DocFolders->DocumentFolder;

?>

tks

1 Solution

Accepted Solutions
Not applicable
Author

I found the solution

Already in operation

Tks

View solution in original post

4 Replies
marcus_sommer

I'm not sure if you could use php for this - but this here should be helpful for you: QlikView Management API - #3 Export / Add / Delete Named CALs.

- Marcus

Not applicable
Author

Hello,

Yes I think it's possible because I could already get the key using SOAP, however I am not able to hit the syntax.

In need of at least one example

Tks

marcus_sommer

Maybe this one is helpful: Re: PHP/SOAP QMSAPI:Document Administrator

- Marcus

Not applicable
Author

I found the solution

Already in operation

Tks