I believe OnPostReload cannot run a macro in the server environment, but I can't find the doc.
Another approach might be to do the looping thing in the vbs module and call it once as a function. So in your load script:
LOAD DoSoapCall() as x AUTOGENERATE 1;
LOAD * FROM soapout.xml;
and in your module:
Make SOAP calls, looping through 100 recs at a time and write all output to file "soapout.xml"
DoSoapCall = "whatever" ' could be count of records or whatever.
Hey, Rob. I hope you're still out there...
I am using your idea and it's working great in devel. But when I deploy it to QEMC (v.10), it looks like QlikView is not able to use FSO to write out the XML file. I'm guessing that QEMC doesn't have access to the File System Object (unless there's some setting someplace???).
FileName = "Try3.xml"
set fso = CreateObject("Scripting.FileSystemObject")
set s = fso.CreateTextFile(FileName, True)
Any ideas on how to get the data from the SOAP response into a file???
You have to set the equivalent of "Allow System Access" in QEMC to allow the CreateObject call to work on server reloads. The setting in QEMC is "Allow unsafe macro execution on server" in System, Setup, Qlikview Servers, Security.
There are some examples here on the forum on how to call a web service using macros. You can also use the script load from URL method if the service supports GET parameters. There are some examples here as well.
One issue that comes up is parsing the returned XML. The QV script xml parser does not support strings as input, only files (last time I checked). So you have two alternatives I know of:
1. Write the returned XML to a file and load using the script support. You can do the writing with an FSO object in the macro. Script STORE doesn't work because it wants to create CSV format which is not proper XML.
2. Parse it yourself using string functions.