简体   繁体   中英

Is it possible to make a soap web service call in VB script from uft tool

I am new to web service. I am trying to send a request and get response from a SOAP webservice from my uft code(VB script). How can I do this. When I try to find a solution, I m being shown how to test webservice. But here I am not testing webservice, it is a part of my flow.

Unified Functional Testing (UFT) = API Testing (formerly Service Test - ST) + GUI Testing (formerly QuickTest Professional - QTP)

From the API testing part of UFT, you can perform the web service call. Then, once you have the API testing call ready (ie: SOAP, REST..) you can call the API testing action from a GUI Testing script (VBScript) using the RunAPITest statement.

For more information, check the below topic from the help files (F1): Tutorials > UFT Tutorial > Part 4: Create and run GUI and API tests in a single test > Lesson 2: Call the API test from a GUI test

There are two ways to do what you want. 1) From the code itself, you can test the service in UFT.this might help http://relevantcodes.com/working-with-webservices/ 2) You can use the UFT APi testing. There you can split the UFT GUI and API Test and run one after another in a flow.

Here is the vb script to call the soap service and get the response.

Dim oXMLHTTP,result

'Request XML
strEnvelope="C:\request.xml" 
url = "soap end point"
Set oXMLHTTP=CreateObject("MSXML2.XMLHTTP.4.0")
oXMLHTTP.Open "Post", url, false
oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
oXMLHTTP.setRequestHeader "Content-Type", "application/xml"
oXMLHTTP.send (strEnvelope)
result = oXMLHTTP.responseText

Set oXMLHTTP=Nothing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM