web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unauthorized Access with crmservice.asmx call

(0) ShareShare
ReportReport
Posted on by 135
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)
  • calechko Profile Picture
    20 on at

    Hey,

     I am having the same problem.  Web service works from my local machine but not from any other machine.  Something wrong with passing the default credentials.  I am using the same user/pass on both machines.

    Did you find a solution?

     Thanks,

    Chris

  • John O'Donnell Profile Picture
    on at

    The guys who wrote that book are MVP's and hang out in the forum i link to below.

     

    Click here to visit the Dynamics CRM forums and chat with the MVP's

    John O'Donnell
    http://blogs.msdn.com/jodonnell
    http://www.twitter.com/jodonnel

    http://blogs.msdn.com/usisvde

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans