Link to home
Start Free TrialLog in
Avatar of Mike Caldwell
Mike CaldwellFlag for United States of America

asked on

How to capture XML returned from a cURL call with VBScript?

I have a VBS program that successfully runs a cURL script, which accesses my API.  XML is returned to the screen fine.  However I want to capture the return from within the VBS script.  Here is what I have:

'*  Run a Curl command line

Set objXMLDoc = CreateObject("Msxml2.DOMDocument")
Set WSHShell = CreateObject("WScript.Shell")			
wSHShell.run("CMD.exe")
wscript.sleep 2000
wSHShell.run("CURL1.bat")

objXMLDoc.LoadXML .responseText

msgbox "Data returned is: " &objXMLDoc.SelectSingleNode("//recordID").text

Open in new window


I swiped the Doc.LoadXML.responseText from another script that worked fine when a log in was not required.    I just need to get the XML text into memory so I can pretty it up for display.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Caldwell

ASKER

I already had it printing to a temp file.  What I am hoping I can get is for the XML stream to return to VBS so that I can format it, embed with some descriptors, and display on screen.  If I have to use a temp file I guess I'll do that, but looking for a way to avoid it.
I don't know how to get it to do that.
I've posted this about three different ways and nobody offers the solution I'm looking for.  So I guess I'll go with the temp file.  Thanks Dave.
You're welcome.  I really don't the way you want exists.