Qlik Community

Ask a Question

QlikView Administration

Discussion Board for collaboration on QlikView Management.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
SatyaQVT
Contributor
Contributor

QlikView QMS API GetDocumentTask returning null

Below Powershell script for GetDocumentTask is returning null. RunTaks, AbortTaks, GetTask are working as expected using the powershell. And also Python script for GetDocumentTask is returing all properties of the task. Please help if I am missing something here.

function GetTimeLimSerKey {
    $service = New-WebServiceProxy -Uri $url -Namespace QlikView -UseDefaultCredential
    $service.GetTimeLimitedServiceKey()    
}

function GetDocTaskAll([String]$TaskID) {
    $scope = "All"
    $hdrs = @{}
    $hdrs.Add("Content-Type","text/xml;charset=uth-8")
    $hdrs.Add("X-Service-Key",$serviceKey)

    $body = @{}
    $body = '<s:Envelop xmlns:s="http://schemas.xmlsoap.org/soap/envelop/">
    <s:Body>
    <GetDocumentTask xmlns="http://ws.qliktech.com/QMS/12/2">
    <taskID>' + $TaskID + '</taskID>
    <scope>' + $scope + '</scope>
    </GetDocumentTask>
    </s:Body>
    </s:Envelope>'

    Invoke-WebRequest -Uri $url -Method Post -Body $body -UseDefaultCredentials -Headers $hdrs
}

$url = "http://QDSServer:4799/QMS/Service"
$TaskId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$serviceKey = GetTimeLimSerKey
$res = GetDocTaskAll -TaskID $TaskId
[xml]$resContent = $res.content
Write-Output $resContent.envelop.Body.GetDocumentTaskResponse.GetDocumentTaskResult
1 Solution

Accepted Solutions
SatyaQVT
Contributor
Contributor
Author

I figured out the issue with the help of my colleague. The parameter should be documentTaskID not taskID.

 

function GetTimeLimSerKey {
    $service = New-WebServiceProxy -Uri $url -Namespace QlikView -UseDefaultCredential
    $service.GetTimeLimitedServiceKey()    
}

 

function GetDocTaskAll([String]$TaskID) {
    $scope = "All"
    $hdrs = @{}
    $hdrs.Add("Content-Type","text/xml;charset=uth-8")
    $hdrs.Add("X-Service-Key",$serviceKey)

 

    $body = @{}
    $body = '<s:Envelop xmlns:s="http://schemas.xmlsoap.org/soap/envelop/">
    <s:Body>
    <GetDocumentTask xmlns="http://ws.qliktech.com/QMS/12/2">
    <documentTaskID>' + $TaskID + '</documentTaskID>
    <scope>' + $scope + '</scope>
    </GetDocumentTask>
    </s:Body>
    </s:Envelope>'

 

    Invoke-WebRequest -Uri $url -Method Post -Body $body -UseDefaultCredentials -Headers $hdrs
}

 

$url = "http://QDSServer:4799/QMS/Service"
$TaskId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$serviceKey = GetTimeLimSerKey
$res = GetDocTaskAll -TaskID $TaskId
[xml]$resContent = $res.content
Write-Output $resContent.envelop.Body.GetDocumentTaskResponse.GetDocumentTaskResult

View solution in original post

1 Reply
SatyaQVT
Contributor
Contributor
Author

I figured out the issue with the help of my colleague. The parameter should be documentTaskID not taskID.

 

function GetTimeLimSerKey {
    $service = New-WebServiceProxy -Uri $url -Namespace QlikView -UseDefaultCredential
    $service.GetTimeLimitedServiceKey()    
}

 

function GetDocTaskAll([String]$TaskID) {
    $scope = "All"
    $hdrs = @{}
    $hdrs.Add("Content-Type","text/xml;charset=uth-8")
    $hdrs.Add("X-Service-Key",$serviceKey)

 

    $body = @{}
    $body = '<s:Envelop xmlns:s="http://schemas.xmlsoap.org/soap/envelop/">
    <s:Body>
    <GetDocumentTask xmlns="http://ws.qliktech.com/QMS/12/2">
    <documentTaskID>' + $TaskID + '</documentTaskID>
    <scope>' + $scope + '</scope>
    </GetDocumentTask>
    </s:Body>
    </s:Envelope>'

 

    Invoke-WebRequest -Uri $url -Method Post -Body $body -UseDefaultCredentials -Headers $hdrs
}

 

$url = "http://QDSServer:4799/QMS/Service"
$TaskId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$serviceKey = GetTimeLimSerKey
$res = GetDocTaskAll -TaskID $TaskId
[xml]$resContent = $res.content
Write-Output $resContent.envelop.Body.GetDocumentTaskResponse.GetDocumentTaskResult

View solution in original post