I've put together the most basic of examples of calling crmservice.asmx following some code I got from the MS Working with Dynamics CRM 4.0, and I'm running into a little problem.
On my local machine, the code works fine. I am able to use the web services to pull information about a given lead. Once I deploy my basic application to our test web server, I start running into problems.
The error that is being generated is:
System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Crm.SdkTypeProxy.CrmService.Retrieve(String entityName, Guid id, ColumnSetBase columnSet) at _Default.RetrieveLead(Guid leadID)
I am assuming that this error is because the DefaultCredentials that are being used in this call are failing to authenticate against the pool of CRM users? Or is it failing to authenticate against our Active Directory store which the CRM (on-premise) sits upon?
In the test web server, IIS 6 is running as a domain account, my website in IIS is set to allow anonymous access and rather than using the IUSR_XXX I am using the same domain account as IIS runs under. This domain account also exists as a user in CRM with System Administrator privalges.
If I hard code my own domain account name and password in the code rather than using the DefaultCredentials it works fine, but I'd much rather use the account that IIS is set to use and have this configured as a system admin user in CRM.
I'm a little lost as to which level of security I'm being kicked back from. Any help with this would be very much appreciated.
*This post is locked for comments
I have the same question (0)