This project is read-only.

Java MSCRM - Documentation

Project Description

Project providing tools which can be used to build a Java interface for Microsoft Dynamics CRM
This project is built around the Apache Axis2 library using the Web Service provided by the Microsoft Dynamics CRM.

This project’s goal is not to rebuild the Microsoft Dynamics CRM in Java only to give a HOW-TO for a good integration interface.


The following software components are necessary to setup the Java MSCRM project environment:

Java MSCRM Project Setup

  • Download Eclipse and add the Apache Axis2 Tools Code Generator Wizard plugin to the Eclipse plugin folder:

  • Download the CRM Service WSDL file:
    • In Microsoft Dynamics CRM 4.0 the CRM Service WSDL file can be reached using the link In the Settings->Customization section
    • Or Microsoft Dynamics CRM 4.0 WSDL file can be directly downloaded using the following link:
      • http://<servername>/MSCrmServices/2007/CrmServiceWsdl.aspx
  • Start Eclipse and launch the Axis2 Code Generator:

  • Select the option Generate Java source code from a WSDL file:

  • Browse for the CRM WSDL file you’ve downloaded:

  • Select the custom Codegen option and xmlbeans Databinding Name:

  • Browse for the output folder where you want to generate the code and click Finish:

  • You should have the following structure in the folder:

  • Create the new JavaMSCRM project and setup the build path to have the following structure:

    In the end this is the .classpath structure you'll have to have:
    <?xml version="1.0" encoding="UTF-8"?>
          <classpathentry kind="src" path="src"/>
          <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
          <classpathentry kind="lib" path=""/>
          <classpathentry kind="lib" path="resources"/>
          <classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
          <classpathentry kind="lib" path="lib/miglayout-"/>
          <classpathentry kind="lib" path="lib/axis2-1.4.jar"/>
          <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
          <classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
          <classpathentry kind="lib" path="lib/neethi-2.0.4.jar"/>
          <classpathentry kind="lib" path="lib/woden-api-1.0M8.jar"/>
          <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
          <classpathentry kind="lib" path="lib/axiom-impl-1.2.7.jar"/>
          <classpathentry kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
          <classpathentry kind="lib" path="lib/wsdl4j-1.6.2.jar"/>
          <classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
          <classpathentry kind="lib" path="lib/axiom-api-1.2.7.jar"/>
          <classpathentry kind="lib" path="lib/axiom-dom-1.2.7.jar"/>
          <classpathentry kind="lib" path="lib/XmlSchema-1.4.3.jar"/>
          <classpathentry kind="output" path="bin"/>
  • You should have the following jars in the lib folder:

  • Insert the Axis2 generated code from the Codegen project
    Copy the resource folder with all its content at the base of the project
    And the com and org folders in the src folder of the project. Finally this the project structure you should have:

    This is the project structure in Eclipse
  • Put all the personal classes in the javaMSCRM package:

  • Add file with the folloing content :

    log4j.rootLogger=ERROR, stdout
    log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:ss} (%F:%M:%L)%n%m%n%n
    Into the bin folder

Getting started

A good way to get started is to go through the already created Views and Forms.
Create / modify / delete entries to see how it works.

Login to Java MSCRM

The first launching of the Java MSCRM project will invite you to enter the connection Settings:

After that you'll be able to login:


The following entites are implemented in the PHPMSCRM for now:

  • Activities
  • Accounts
  • Contacts
  • Opportunities
  • Leads
  • Users

You can reach them through the Menu:

For each entity there is a View with the following options when possible.

  • Columns sort
  • Letter Filter
  • Owner filter
  • Search Feature
  • New entry link
  • Delete delete entries button to delete the selected entries

For each entity there is a Form with the following options when possible :

  • Create new Entry
  • Consult existent Entry
  • Update existent Entry
  • Delete existent Entry

The Look Up Records Field is already implemented:

Last edited Mar 14, 2011 at 12:07 AM by zivanov, version 6


Mafter111 Oct 10, 2012 at 8:39 PM 
I was able to go through the tutorial but how do you actually build and run the project from Eclipse? I am new to Eclipse..

I also tried connecting using the tester but it keeps giving me invalid user/pass error.

BTW, I am using the 2007 WSDL from the 2011 installation. Also tried using the WSDL provided in the project.

I hope you can help out.

kaddy Aug 30, 2012 at 12:19 AM 
Any one able to get pass "can't serialize the policy ..." error mentioned above? If yes then please share your experience.

zivanov Jul 20, 2012 at 7:52 AM 

I've only tested this project against the 4.0 version. In theory it should work with the 2011 version too but having never tested it i can't tell you much about this error.

botem Jul 18, 2012 at 10:14 AM 
I use 'Apache Axis2 Tools Code Generator Wizard plugin for Eclipse 1.6.2' to generate Java code for on-premise MS CRM 2011, and got an error

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

Any comments?