locked
Accessing Microsoft CRM 2011 From Java RRS feed

  • Question

  • I had a few questions about microsoft crm 2011 (on-premise deployment) connectivity through soap web services. It would be appreciated if someone could help out
    1. What are the different authentication methods to connect to microsoft CRM 2011 soap web services? I understand Active directory authentication is one way through which one can pass his domain credentials to authenticate. This would mean that the crm is configured with ADFS. We are planning to integrate CRM with our application to pull data from it. It would not be practical to accept the user's admin credentials and save it in our application. What are other authentication methods?
    2. What are the steps to authenticate a user on an on-premise installation? I tried the C# code sample and it seems to work but couldn't find a corresponding one for java. I followed the steps giving in java2crm sample of SDK but that one is for online deployment connectivity. 

    Kindly let me know your thoughts.

    Regards,
    Amit.


    Technet Forum Issue

    Thursday, June 5, 2014 10:36 AM

All replies

  • Hi,
    connect to CRM using Java can be quite challenging. Normally in these scenarios I suggest to build a C# webservice that will act as proxy between CRM and your Java application.
    The C# webservice can connect and pull data easily from CRM (as your already found using the code sample) and because is your webservice you can control the protocol (REST or SOAP) and the methods returned, in this way will be easier for access from a Java Application.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Thursday, June 5, 2014 10:41 AM
  • Do you the details of how is the C# sample code authenticating? I doesn't seem to generate classes from wsdl. I tried looking for the same java classes (generated through axis2)  from the C# code but couldn't link them.

    Also what are the challenges in connecting from Java? 


    Technet Forum Issue

    Thursday, June 5, 2014 11:48 AM
  • For connecting there is the simplified connection (it works also with CRM OnPremise), just create a connection string with the right credentials and you will get the organizationservice object. You need to add also these additional references: Microsoft.Xrm.Sdk.Client and Microsoft.Xrm.Client.Services

    // create an account inside CRM
    CrmConnection crmConnection = CrmConnection.Parse("Url=http://server/organization; Username=usernamehere; Password=passwordhere;");
    OrganizationService service = new OrganizationService(crmConnection);
    
    Entity account = new Entity("account");
    account ["name"] = "Test Account";
    
    Guid accountId = service.Create(account); 
    The challenge using Java is that your requests are all SOAP (if you don't generate classes of course), from C# you have the CRM SDK dlls and it is not necesary to write SOAP at all.


    My blog: www.crmanswers.net - Rockstar 365 Profile


    Thursday, June 5, 2014 12:09 PM
  • Ok. I understand.

    The SDK toolkit includes a sample for connecting through java but that one is for connecting to a online crm instance. Do you know what would be the classes and methods to be called on the generated stubs for the on-premise instance. I wonder why it is not included in the SDK or mentioned anywhere on the internet? 


    Technet Forum Issue

    Thursday, June 5, 2014 12:16 PM
  • I'm sorry but I never used Java to connect to an OnPremise instance, and I don't know why a sample is not included inside the SDK (most probably because Dynamics CRM is used inside a Microsoft stack choice)

    But you can check these links, hope it helps:

    http://stackoverflow.com/questions/23545851/calling-microsoft-crm-2011-on-premise-web-service-with-cxf

    http://javamscrm.codeplex.com/documentation


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Thursday, June 5, 2014 12:22 PM