Micro Focus QTP (UFT) Forums
Issue in Web services with 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Issue in Web services with QTP. (/Thread-Issue-in-Web-services-with-QTP)



Issue in Web services with QTP. - qtpexpert - 05-06-2013

Hi,
I am using QTP11.Windows7.
For web services Testing i have installed web services add in qtp, installed .NET2.0WSE3.0.
I am using WS-I validation tool platform - .NET .created input XML file.
I have created web sevices through web services wizard.i have validate the WSDl . it is perfect.
My code is ......

Code:
Dim ssr0XML,XMLstr
Set ssr0XML = XMLUtil.CreateXMLFromFile("D:\QTP_RAZOO\CityWeathe r.xml")
XMLstr=ssr0XML.ToString
msgbox XMLstr
wait(5)
WebService("WeatherService").SendRequest GetCityWeatherByZIP, XMLstr

in the last line qtp is throwing the following error.

"The GetCityWeatherByZIP operation call failed.
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
Exception from: System.Web.Services
The request failed with HTTP status 417: Expectation failed.

Line (3):
Code:
"Set GetCityWeatherByZIP = WebService("WeatherService").GetCityWeatherByZIP(" string (Autogenerated)")". "

But without using addin qtp is working fine. qtp is able to send the request and receives the request.

I tried in different ways. but i couldnot resolve this issue.
If any one knows the solution kindly provide the solution.

Thanks in advance.


RE: Issue in Web services with QTP. - Saket - 05-06-2013

see if this helps
https://www.learnqtp.com/category/web-services/


RE: Issue in Web services with QTP. - qtpexpert - 05-06-2013

Thanks for you reply.
already i have read the article and tried with that. without addin it is working fine. But by using addin it is throws the above mentioned error.

pls share your ideas.

Thanks in advance.


RE: Issue in Web services with QTP. - Saket - 05-06-2013

if you are using webservice object, use the method directly like WebService("WeatherService").GetCityWeatherByZIP rather WebService("WeatherService").SendRequest


RE: Issue in Web services with QTP. - qtpexpert - 05-07-2013

Thanks for your quick response.
As per your suggestion, I tried to execute the script . But qtp is throwing the following error..

"The GetCityWeatherByZIP operation call failed.
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
Parameter count mismatch.

Exception from: mscorlib
Parameter count mismatch.

Line (13): "WebService("WeatherService").GetCityWeatherByZIP, XMLstr". "

I have a doubt here..

Is it necessary to use the XMLwarehouse when using the webservices testing wizard
I did not add any input data in XMl structure...Because of that is it throw an error..

Any other ideas...

Thanks.


RE: Issue in Web services with QTP. - Saket - 05-10-2013

Yes, you are right. You should use XMLWarehouse and enter the input data there.


RE: Issue in Web services with QTP. - qtpexpert - 05-10-2013

Thanks for your reply.But i am using extenal file(xml file) for input data.is it necessary to enter the input data when we use external file (xml file)for input data.
kindly clarify my doubt and if it is necessary, how to enter the input data.

Note: I tried with that but XMLWarehouse is not getting displayed in my script.
I tried ....> File -->settings-->XMLWareHouse . Here i have uploaded the the xml file. another one is Ihave created input dtata manually here.

for above mentioned both i tried but i am getting the same error message "Object not set to an instance of object"