This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem creating Accounts using DynamicEntity in MsCrm4.0

Yuva Kumar
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create an Account using DynamicEntity in MsCrm4.0. Following is the code snippet. I would like to mention the following:

1. The same code(ref Code 2 below) creates an Account successfully when used in MsCrm3.0

2. I am able to create Account in MsCrm4.0, if I dont use DynamicEntity(ref Code 1 below).

3. The MsCrm4.0, the IIS security - IWA and Basic authentication is enabled.

Could someone pl suggest what am I doing wrong w.r.t MsCrm 4.0? I dont see any issue with security, as I am able to create record if I use Code 1 below. Maybe I am wrong?


Code 1: This works in same CRM, MSCrm 4.0

Account account=new Account();
account.setName("ac crm3-2");


String id = binding.create(account);
System.out.println("Account id = "+id);
}catch(Exception e){

Code 2 : This DOESNT work in same CRM, MSCrm 4.0
try {

// Set the properties of the contact using property objects.
StringProperty firstname = new StringProperty();
StringProperty lastname = new StringProperty();
lastname.setValue("Aaberg using Dyn Entity-3");

DynamicEntity contactEntity = new DynamicEntity();

Property[] property = new Property[] {firstname, lastname};

TargetCreateDynamic targetCreate = new TargetCreateDynamic();
CreateRequest create = new CreateRequest();

// Execute the request.
CreateResponse created = (CreateResponse)binding.execute(create);

System.out.println("\nContact Created : "+created.getId());

} catch (RemoteException e) {
System.out.println("Create result RemoteException "+e);

Failed Response :

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server was unable to process request.</faultstring><detail><error>
<description>An unexpected error occurred.</description>
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic