Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to reload two documents using TriggerEDX(), but still I'm trying to load one:
Sub TriggerEDX()
Dim objHttp
Dim strUrl
Dim strData
Dim strKeyRequest
Dim strKeyAwnser
Dim strTaskName
strTaskName = "MyMountedFolder/MyFileName.qvw"
Dim strTaskPassword
strTaskPassword = "MyPassword"
' Create a HTTP instance
Set objHttp = CreateObject("Microsoft.XMLHTTP")
strUrl = "http://MyServerName/qtxs.asmx"
strKeyRequest ="<Global method=""GetTimeLimitedRequestKey"" />"
objHttp.open "POST",strUrl,false
objHttp.setRequestHeader "Content-Type","text/xml"
objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
objHttp.Send strKeyRequest
'Parse the awnser
'msgbox(objHttp.ResponseText)
Dim strKey
strKey = ParseKeyAwnser(objHttp.ResponseText)
'Get the string to send in the request that triggers the task
Dim strEDXRequest
strEDXRequest = GetEDXRequestString(strKey,strTaskName,strTaskPassword)
'Do the actual request to trigger the task
objHttp.open "POST",strUrl,false
objHttp.setRequestHeader "Content-Type","text/xml"
objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
objHttp.Send strEDXRequest
'Get the awnser, the awnser can contain different things but for now I only care to see if we find success
dim strAwnser
strAwnser = objHttp.ResponseText
if(Instr(strAwnser,"<TaskStartResult>Success</TaskStartResult>") > 0) then
msgbox("Success")
else
msgbox(strAwnser)
end if
ActiveDocument.GetSheetObject("BU11").Press
End Sub
Function ParseKeyAwnser(strKeyAwnser)
Dim intStartPos
Dim IntKeyLen
'msgbox strKeyAwnser
'Get the starting and the end position of the key
intStartPos = InStr(strKeyAwnser,"<GetTimeLimitedRequestKeyResult>")+Len("<GetTimeLimitedRequestKeyResult>")
intKeyLen = InStrRev(strKeyAwnser,"</GetTimeLimitedRequestKeyResult>") - intStartPos
'Get and return the key
msgbox strKeyAwnser
'msgbox intStartPos
'msgbox intKeyLen
ParseKeyAwnser = Mid(strKeyAwnser,intStartPos,intKeyLen)
End Function
Function GetEDXRequestString(strRequestKey,strTaskName,strTaskPassword)
'Make the string and insert the key
GetEDXRequestString = "<Global method=""RequestEDX"" key=""" & strRequestKey & """><i_TaskIDOrTaskName>" & strTaskName & "</i_TaskIDOrTaskName><i_Password>" & strTaskPassword & "</i_Password><i_VariableName /><i_VariableValueList /></Global>"
End Function
msgbox strKeyAwnser displays:
objHttp.ResponseText: <html>
<head>
<title>The resource cannot be found.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>
the script stops at the function ParseKeyAwnser in "ParseKeyAwnser = Mid(strKeyAwnser,intStartPos,intKeyLen)" because "intKeyLen" has a negative value...
my knowledge is Webservices are few and the script I have gone through another site ... I do not know exactly how I have to put the strUrl or the path to the document (strTaskName)
any ideas? a little help?
Thanks
Are you connecting to the correct port? Publisher typically listens on port 4720.
I have tried putting the port "4720" because I have seen in other examples, but then the script stops in "objHttp.send strKeyRequest".
How can I find the correct port?
Thanks
You can find the port used by Publisher in the Qlikview Enterprise Management Console; go to System->Setup->QDS@<server>->Summary.
Also you have to connect to the server with NTLM authentication as a user that is part of the QlikView Administrators group (I believe this requirement was relaxed a bit with 9.0 SR1).
It's under the Distribution Services entry which appears to be not expandable in your instance. Have you entered your publisher license?
Hi,
We use the standard edition that comes with the server...
Do we have to indicate another license number?
Do we need the enterprise edition?
THANKS
Hi,
Nobody knows if I need the publisher enterprise edition to use TriggerEDX()?
I need to reload two documents on the server
Thanks
Hi,
Anyone know if I can use TriggerEDX() with the the publisher standard edition?
Thanks
Hi,
Nobody knows if I need the publisher enterprise edition to use TriggerEDX()? The Distribution Services entry appears not expandable in Qlikview Enterprise Management Console. We only have publisher standar edition (version that is included with the server)
I need to reload documents on the server...
Thanks