The request failed with HTTP status 401: Unauthorized RRS feed

  • Question

  • Hi

    Im trying to make a simple update using crm web serices.

    When I deploy my ASP.NET application to the dev server, then run the app in the browser locally, i dont get any errors. Updates go thru succesfully.

    When i run the app in the browser from my local computer, i get the following error:

    System.Net.WebException: The request failed with HTTP status 401: Unauthorized

    I do use:  Windows as authentication, Impersonate user, Disable Anonymous Access, Enable Windows Authentication

    Am I miising something?



    Wednesday, June 2, 2010 6:21 PM


All replies

  • This is the code that Im using:

    CrmService service = new CrmService();
    CrmAuthenticationToken token = new CrmAuthenticationToken();
    token.OrganizationName = "OrganizationName";
    service.Url= "http://crmdev/MSCrmServices/2007/CrmService.asmx";
    service.CrmAuthenticationTokenValue = token;
    service.PreAuthenticate = true;
    service.Credentials = CredentialCache.DefaultNetworkCredentials;
    Wednesday, June 2, 2010 6:23 PM
  • Is your machine & server on  the same domain? if  domain  is different,  Is "Trust For Delegation" enabled.

    Did you deploy your asp.net applicaiton  inside MS CRM ISV.Config?

    Does your browser has windows authentication enabled ?


    • Must be member of a trusted domain
    • Ensure the URL being used is part of the Internet Explorer trusted sites
    • Internet Explorer must be set to use Integrated Authentication (In IE, click Tools > Internet Options > Advanced > scroll to Security)

    also read this for more details.



    Muhammad Ali Khan
    Wednesday, June 2, 2010 6:40 PM