locked
Crmservice RRS feed

  • Question

  • Hi

    I am trying to develop a piece of code from my laptop whose login credential are not a user of ms crm environment.
    so for this purpose, i am using hard coded credential of a user who is member of ms crm 4

    now, as i am not a member of crm , i am not able to add crm service as a web reference to my solution.
    for this purpose, i added crmservice url as hard coded value in web config..


    will it work..
    Wednesday, December 23, 2009 10:29 PM

Answers

  • Hi you can still add the webreference. Right click on project ==> Add Web Refrence, type the Webservice URL and click go. It will ask for the Login Credential. Here you can specify the credential of any ms crm user.
    After that a proxy class will be generated to you.
    Now in your code since you are not a crm user, you can use the crm user credential like this.

    CrmAuthenticationToken token = new CrmAuthenticationToken();
                        token.AuthenticationType = AuthenticationType.Passport;
                        token.CrmTicket = crmTicketResponse.CrmTicket;
                        token.OrganizationName = "your_Organization_name_here";

                        CrmService crmService = new CrmService();
                        crmService.Url = "CRM Service URL Here;
                        crmService.CrmAuthenticationTokenValue = token;

    & you can set your network ms crm user credentail like this.
    crmService.Credentials = new System.Net.NetworkCredentials("crm_username","password","domain");

    Thursday, December 24, 2009 3:40 AM

All replies

  • Hi you can still add the webreference. Right click on project ==> Add Web Refrence, type the Webservice URL and click go. It will ask for the Login Credential. Here you can specify the credential of any ms crm user.
    After that a proxy class will be generated to you.
    Now in your code since you are not a crm user, you can use the crm user credential like this.

    CrmAuthenticationToken token = new CrmAuthenticationToken();
                        token.AuthenticationType = AuthenticationType.Passport;
                        token.CrmTicket = crmTicketResponse.CrmTicket;
                        token.OrganizationName = "your_Organization_name_here";

                        CrmService crmService = new CrmService();
                        crmService.Url = "CRM Service URL Here;
                        crmService.CrmAuthenticationTokenValue = token;

    & you can set your network ms crm user credentail like this.
    crmService.Credentials = new System.Net.NetworkCredentials("crm_username","password","domain");

    Thursday, December 24, 2009 3:40 AM
  • Can you access CRM using the credetial you have? If answer is no then you can not access CRM webservice in you application.
    Thursday, December 24, 2009 4:22 AM
  • you can download crm web service file and then add them web referance locally as well...then use the URL mentioned in the web.config to retrieve and use CRM service...

    you can download web service files from Settings --> Customization --> download Web Service Description files in CRM..

    Let me know if you need more info on this..
    Thursday, December 24, 2009 9:43 AM