Micro Focus QTP (UFT) Forums
Webservices (QTP 10.0) on microsoft Dynamic CRM 4.0 - 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: Webservices (QTP 10.0) on microsoft Dynamic CRM 4.0 (/Thread-Webservices-QTP-10-0-on-microsoft-Dynamic-CRM-4-0)



Webservices (QTP 10.0) on microsoft Dynamic CRM 4.0 - swetha.b - 02-18-2010

Hi All,

I have been struggling harder since couple of days to do a simple fetch query operation on dynamics CRM (web services) using QTP 10.0 web services wizard.

These are the steps I followed on web services testing wizard for creating a fetch script:
1) Gave the correct WSDL URL and checkd the option " Include security settings in the generated web services test"
2)After giving the proper credentials, the default security token was set to 'Network Credentials'. (Note: Did not check the other available credentials.
3) I selected 'Fetch' operation from the available operations.
4)Included XML checkpoint
5) Web services test has been generated and the script looks like :

Code:
[color=#32CD32]' Set security options for the "CrmService" Web service
WebService[/color]("CrmService").Security.SetNetworkCredential "osmosysprod\gs", "Change123", "osmosysprod"
[color]' CrmService Web service object steps[/color]
Fetch = WebService("CrmService").Fetch("string (<entity name='account'><attribute name='name'/><attribute name='primarycontactid'/><attribute name='telephone1'/><attribute name='accountid'/><order attribute='name' descending='false'/><filter type='and'><condition attribute='name' operator='like' [color=#FF1493]value='%vishnu%'/></filter></entity>)")
[color]'Includes the check point[/color]
WebService("CrmService").Check CheckPoint("Fetch")

When I run this script I get the following error:
Please look at the attached file for the error screenshot. (WS Error)

For instances when the check box of the first step is not checked then the error would be : "Eception from: System.web.Services
The request failed with HTTP status 401:Unauthorized"

Note: Fetch string(Autogenerated) in the script was replaced with my script.

Ca anyone help me understand where did I go wrong ???

Thanks in advance

Swetha