locked
Error de la solicitud con el código de estado HTTP 401: Unauthorized RRS feed

  • Question

  • I get this error (from the title) when aspx functionality is called. But this functionality worked fine until last week and the programming hasn't been touched. I put the part of the autorization (in the programming) here below. Maybe someone has an idea about changes in the contents of the database itself that can lead to the error I get. 

     private CrmService CreateServiceInstance()
      {

       CrmService service = new CrmService();

       //Using localhost requires the page to run on the CRM server box.
       string urlSrv = ConfigurationSettings.AppSettings["urlServidor"];
       string crmUsr = ConfigurationSettings.AppSettings["uidAdmin"];
       string crmPwd = ConfigurationSettings.AppSettings["pwdAdmin"];
       string crmDom = ConfigurationSettings.AppSettings["dominio"];
       // Entra con credenciales de administrador para poder crear la obra
       System.Net.NetworkCredential credenciales =
        new System.Net.NetworkCredential(crmUsr,crmPwd,crmDom);
       service.Url = "http://" + urlSrv + "/mscrmservices/2006/crmservice.asmx";
       service.Credentials = credenciales;
                            service.Credentials = System.Net.CredentialCache.DefaultCredentials; 
        
       return service;
      }

      private MetadataService CreateMetadataServiceInstance()
      {

       MetadataService service = new MetadataService();

       //Using localhost requires the page to run on the CRM server box.
       string urlSrv = ConfigurationSettings.AppSettings["urlServidor"];
       string crmUsr = ConfigurationSettings.AppSettings["uidAdmin"];
       string crmPwd = ConfigurationSettings.AppSettings["pwdAdmin"];
       string crmDom = ConfigurationSettings.AppSettings["dominio"];
       // Entra con credenciales de administrador para poder crear la obra
       System.Net.NetworkCredential credenciales =
        new System.Net.NetworkCredential(crmUsr,crmPwd,crmDom);
       service.Url = "http://" + urlSrv + "/mscrmservices/2006/MetadataService.asmx";
       service.Credentials = credenciales;
       return service;
      }

    Thursday, November 11, 2010 2:43 PM

Answers

All replies