How to call Web Service throgh VB Script
In our application we are calling web service which takes XML as input.
We are using the following code to pass XML Object to webservice
the below code is working fine for the weservice which accept String as input but it is not working for the XML.
Const HOST = "http://localhost/"
Const URL = "TaipeiWebService/aa.asmx"
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
Set XMLObj = XMLUtil.CreateXMLFromFile("C:\test.xml")
xmlhttp.open "POST", HOST & URL & "/AddValue", false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send "doc=" & XMLObj
I really appriciate the comment or solution in this topic because my requirement is very ******.
Re: How to call Web Service throgh VB Script
Have you figured out how to post an XML file? If so, please let me know.
In the meantime, you may try to open the XML file from you QTP, and read the content to a string, then pass the string as the argument to xmlhttp.send, you should get the response.
Hope it works for you.