locked
Can't connect to CrmDeploymentService.asmx from Deployment Server RRS feed

  • Question

  • Hi there,

            I want to connect my CrmDeploymentService.asmx from my Crm Deployment server and my Deployment Service is on same  server. 

            I m using correct url ServerUrl: http://deploymentServer:5555/MSCRMServices/2007/CrmDeploymentService.asmx 
           and correct credentials (of Crm Deployment Admin's) but getting this error when 

    retrieving all crm Organizations:

           Exception: The request failed with HTTP status 401: Unauthorized..StackTrace:    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 CreateCRMOrg.DeploymentServer.CrmDeploymentService.Execute(DeploymentServiceRequest 

    Request)
       at GetAllCrmOrgs.Program.Main(String[] args)

         I have also tried Default Credentials System.Net.CredentialCache.DefaultCredentials 

    but no benefit. I have logged into crm Deployment  server using Crm Deployment Admin Credentials.

         Thanx in anticipation of a solution.

          Regards,
    Thursday, August 13, 2009 2:03 PM

Answers

  • Hi,

         I am somewhat succesfull in getting all crm Orgs using 'LocalHost' instead of Server name in the Deployment Service URL, i.e. 

    service.Url = "http://LocalHost:5555/MSCRMServices/2007/CrmDeploymentService.asmx

       But problem is that using Localhost in the url I can't connect this service from outside this Deployment Server.

       I need it to connect from App Server, some other server. Can anyone suggest what is the problme ?

       Regards,
       
    • Marked as answer by Cyber Friend Monday, August 17, 2009 3:27 PM
    Thursday, August 13, 2009 9:59 PM
  • Hi,

            This may be server specific problem as when I installed crm Deployment Server role on some other server I was able to access its url using Server name.

            Regards,
        
    • Marked as answer by Cyber Friend Monday, August 17, 2009 3:27 PM
    Monday, August 17, 2009 3:26 PM

All replies

  • Hi,


    Have a read of the post at Nishant's blog. It has sample code to retrieve organization information. 
    http://nishantrana.wordpress.com/2008/10/26/using-crmdeploymentservice-crm-40/

    The post also has a link to download the deployment service SDK. (Incase you haven't downloaded it already).

    Your access method looks fine. Please insure that your logged in as a user that is member of the deployment administrators. You can check this via the MS CRM deployment manager tool.

    Hassan.


    Hassan Hussain | http://hassanhussain.wordpress.com/
    • Proposed as answer by Hassan Hussain Thursday, August 13, 2009 3:16 PM
    Thursday, August 13, 2009 2:27 PM
  • Hi,

          I m using almost same code as nishant rana's blog. The main thing is that my crm roles are split on 5 servers i.e      DeploymentServer, Web Application Server, SQL server, Report Srver, Asynchnronous Service Server. I m using DCRM Deployment Admin's credentials.

          I m running code on Deployment Server. I have run this code on Appliction Server too but no benefit. 

          Here is code:

               
                CrmDeploymentService service = new CrmDeploymentService();            
                
                ICredentials credentials = new NetworkCredential(user,pwd ,domain);   
                
                service.Credentials = credentials;     
    
                service.Url = "http://deploymentServer:5555/MSCRMServices/2007/CrmDeploymentService.asmx";
                service.PreAuthenticate = true;   
                
                // First retrieving all Organization to Verify the Credentials
                RetrieveAllRequest myRetriveAllRequest = new RetrieveAllRequest();
                myRetriveAllRequest.EntityName = DeploymentServer.EntityName.Organization;
                Console.WriteLine("\nRetrieving all organizations ");
                RetrieveAllResponse myRetriveAllResponse = (RetrieveAllResponse)service.Execute(myRetriveAllRequest);
                Organization myOrganization = null;
                Console.WriteLine("\nFollowing CRM Orgnaizations found\n");
                foreach (DeploymentEntity myEntity in myRetriveAllResponse.Entities)
                {
                    myOrganization = (Organization)myEntity;
                    Console.WriteLine("\tOrganization found: " + myOrganization.UniqueName);
                }

    Infact I have some other Dynamics CRM server , where I have all roles on single server, and this code is running very fine on that server without any trouble. 

    Waiting for your reply.

    Regards,
    Thursday, August 13, 2009 8:00 PM
  • Hi,

         I am somewhat succesfull in getting all crm Orgs using 'LocalHost' instead of Server name in the Deployment Service URL, i.e. 

    service.Url = "http://LocalHost:5555/MSCRMServices/2007/CrmDeploymentService.asmx

       But problem is that using Localhost in the url I can't connect this service from outside this Deployment Server.

       I need it to connect from App Server, some other server. Can anyone suggest what is the problme ?

       Regards,
       
    • Marked as answer by Cyber Friend Monday, August 17, 2009 3:27 PM
    Thursday, August 13, 2009 9:59 PM
  • Hi,

          I m still not able to connect my crm Deployment server using Server name.

          I can connect Deployment Server using Local Host  but not using its Server name.

    I need to connect Deployment server from some other server that's why i need to connect it using Server name.

    Is there any solution?


    Regards,
    Friday, August 14, 2009 4:27 PM
  • Hi,

            This may be server specific problem as when I installed crm Deployment Server role on some other server I was able to access its url using Server name.

            Regards,
        
    • Marked as answer by Cyber Friend Monday, August 17, 2009 3:27 PM
    Monday, August 17, 2009 3:26 PM
  • Hi,

    I am also seeing this problem. The same code, running locally on the crm server works when using localhost but not servername. Visiting the CRM site in IE works with both localhost and servername.

    Did anyone work out why this might be happening?

    Regards
    Wednesday, October 21, 2009 2:11 PM