| || |
Error while testing Web Service using QTP11.0
I need to test web service using QTP. iread few articles related to it and got basic information about the testing procedure. I am able to test w3schools WSDL and understood its basic functionailty. Finally after modifying XML Checkoint i could pass it also.
But situation is not same when i work with my WSDL. I can generate the code, provided below,
' Set security options for the "GetActivity" Web service
WebService("GetActivityService").Security.SetNetwo rkCredential "", "", ""
' GetActivity Web service object steps
Set GetActivity = WebService("GetActivityService").GetActivity ("string (Autogenerated)","string (Autogenerated)","string (Autogenerated)")
but when i am trying to execute the same getting the below error, remeber i didnt make any changes to the code or to checkpoint
The GetActivity operation call failed.
The .NET Framework 1.1 WSE 2.0 toolkit returned the following error:
Exception from: System.Xml
The <html> tag from namespace is not expected. Line 1, position 2.
Line (6): "Set GetActivity = WebService("GetActivityService").GetActivity ("string (Autogenerated)","string (Autogenerated)","string (Autogenerated)")".
Can anybody please guide me what i need to do.
Thanks in Advance.
This is what I did. Hope it helps.
WebService("CustomQuery*R").SendRequest "QueryCustomerItem", xml
respxml = Webservice("CustomQuery*R").LastResponse
Set fso = CreateObject("Scripting.FileSystemObject")
Set xmlfile1 = fso.OpenTextFile("C:\QTP TP\Webservice\SoapRequest.xml",2,TRUE)
result = XMLFile("SoapRequest.xml").Check (CheckPoint("SoapRequest.xml"))
If result Then
Reporter.ReportEvent "Pass","Webservice check point","Response of webservice is as expected"
Reporter.ReportEvent "Fail","Webservice check point","Response of webservice is not as expected"
There might be something wrong with the WSDL. The way you are using the web service object will only work if the WSDL is correct and provides sufficient information to generate correct request XML. An alternative is to get the devs to give you a sample request XML that you store in the XML warehouse and parameterise and then use that and the sendRequest method of the service object.
try to check with soapui if you are able to send request and getting proper response