Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Maybe this one is helpful: Re: PHP/SOAP QMSAPI:Document Administrator
- Marcus
I found the solution
Already in operation
Tks