Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-01-25
5
Medium Priority
?
247 Views
Last Modified: 2015-01-26
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.
0
Comment
Question by:Mike Caldwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40569920
Try adding "-o mygettext.xml" to your cURL command.  http://www.thegeekstuff.com/2012/04/curl-examples/  Then you can read the file.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569924
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.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40569947
I don't know how to get it to do that.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40570023
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.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40570105
You're welcome.  I really don't the way you want exists.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question