Thursday, March 3, 2011

Connecting to Microsoft CRM 2011 Online from Java?

Are you interested in connecting to the Microsoft Dynamics from Java?

Here is the Java code example that shows the invocation of the RetrievePolicy, RetrieveCrmTicket, RetrieveMultiple and other MS CRM 4.0 web services over SOAP:

10 comments:

Unknown said...

Big ZD getting fingers dirty with the code. :)

Henry said...

Umm ... instead of using xml templates, why don't you generate stubs via Java2WSDL?

Unknown said...

Hi there,

I've tried to use the class you've posted. I've created a project in eclipse with this code but no luck yet.

Do i have to have a gooddata account to use this?

If not can you help me setup a project to connect to my mscrm online deployment?

Thanks in advance.

Deepak said...

This is using the the older 2007 endpoint from CRM 4 to connect to CRM 2011. While CRM 2011 is backwards compatible with this, this functionality is deprecated and "will be removed in a future release of Microsoft Dynamics CRM 2011".

I recommend switching to use the new 2011 endpoint for connecting to CRM 2011.

Anonymous said...

Hi,
when i call connect in MyDynamicsWrapper
method retrieveCrmTicket() throws exceptions:

com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/plain. Is this an error message instead of a SOAP response?
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:157)
at com.gooddata.integration.soap.SoapExecutor.execute(SoapExecutor.java:76)
at com.gooddata.integration.soap.SoapExecutor.execute(SoapExecutor.java:60)

at com.gooddata.msdynamics.MsDynamicsWrapper.retrieveCrmTicket(MsDynamicsWrapper.java:157)
at com.gooddata.msdynamics.MsDynamicsWrapper.connect(MsDynamicsWrapper.java:118)

pbattisson said...

Hey, with the 2011 endpoints I get the following error:

Bad Response; Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.

Any ideas on how to resolve this?

Thanks

Anonymous said...

how do I create the following object CrmAuthenticationTokenDocument ?
we could not find this object on the standard webservice.
any idea ?

Unknown said...

0 down vote favorite


I tried to generate Java code using 'Apache Axis2 Tools Code Generator Wizard plugin for Eclipse 1.6.2', and got an error below

A error occurred while completing process - java.lang.InterruptedException: org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: can't serialize the policy ...

Any idea?

Unknown said...

Does any one tried to insert bulk records in MS dynamics using java

Yadesh said...

Hi All,

How can i call the execute method of crm webservice using java stubs.

Can someone please help me on this?
Thanks in Advance