0

Am trying to post a request and get a response through VBS.

Dim response
Set xHttp = CreateObject("Microsoft.XMLHTTP")
xHttp.Open "POST", "https://idoc-api-int.platform-test.sample.com/interactiveDocumentOrchestrator", False, u1i, p1i
xHttp.Send
response = xHttp.responseText
Msgbox response

Basically, I'm using SOAP UI to send a request to the URL with a body content and I will be getting the response. I'm trying to achieve it through a VBScript. Kindly suggest if there is any way I am able to do this.

user692942
  • 16,398
  • 7
  • 76
  • 175
  • 1
    Soap UI builds the SOAP Envelope for you, when using VBScript you’d have to do this yourself. What are you sending in the POST body? Looks to me like you aren’t sending a POST body, so how do you expect this to work? – user692942 Oct 31 '17 at 08:34
  • Yes you are correct ..! But am not sure ..how i can pass the body part here..And am not able to get any sample code also ..If you any sample please paste here..That will be helpful.. – Punitharaj Surya Nov 02 '17 at 09:30
  • There are examples around you just [have to look](https://stackoverflow.com/a/37462944/692942). The key is to pass your "data" *(whether it be an XML, JSON or just key-value pairs)* in the [`Send()` method](https://support.microsoft.com/en-us/help/290591/how-to-submit-form-data-by-using-xmlhttp-or-serverxmlhttp-object). – user692942 Nov 02 '17 at 09:57
  • 1
    thanks for that ..!! It is working fine now.!! – Punitharaj Surya Nov 08 '17 at 03:55
  • Glad the example was useful. – user692942 Nov 08 '17 at 09:33

0 Answers0