Sending soap request in qtp - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Sending soap request in qtp (/Thread-Sending-soap-request-in-qtp) |
Sending soap request in qtp - ugandhar - 02-24-2011 Hi , need help on webservices testing i want to sent SOap xml as request using post method and verify the xml content need some sample code on webservices testing tugandhar@gmail.com RE: Sending soap request in qtp - rajeshwar - 02-24-2011 Hi ugandhar, You can use web Service testing Wizard provided by QTP for testing webservices. Else can be done using WinHttpRequest object. First Create an properly formatted request XML. 'Create Object of WinHttp.WinHttpRequest.5.1 Code: Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") Code: WinHttpReq.SetTimeouts 30000, 30000, 30000, 30000 Code: WinHttpReq.Open "POST", ServerName, False Code: WinHttpReq.SetRequestHeader "Content-Type", "text/xml;charset=utf-8" 'Define connection values. Code: HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0 'Send connection authorization credentials. Code: WinHttpReq.SetCredentials UserName, Password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER Code: WinHttpReq.Send(strXML) Code: sResponseText = CStr(WinHttpReq.ResponseText) Verify what ever Tag you want to verify. |