Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AXIS2 - set conditions - XmlValueDisconnectedException

 
Lidija Sketa
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi group,

I have no luck setting condition when connecting to the microsoft crm's web service. I can't set query condition correctly when retrieving data from CRM.

The problem is the following code:



In the last line I get the following Exception:



How should I create XmlObject so it would be valid? Any help would be highly appreciated.

Regards,
Lidija
 
rashmi shivanna
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Even i am facing the same problem did you get the soloution . if you have got can you please share it with me .
thanks in advance
 
Lidija Sketa
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I didn't manage to resolve the problem so I did a workaround: I changed WSDL from which AXIS2 creates Java classes.

I created a new definition for ArrayOfAnyType that contains a string:


Then I changed all necessary values of type ArrayOfAnyType into ArrayOfStringValue.

I don't use XmlObject anywhere in the code. Another way to execute queries is by xml fetch:

.. where fetchS is composed XML string.

Regards,
Lidija
 
rashmi shivanna
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I tried that still i am getting axis error . i changed arrayofanytype arryaofstringvalue . can you please have look at my code . please .


query.setColumnSet(AllColumns.Factory.newInstance());
query.setEntityName(EntityName.NEW_RESIDENTIALSUBSCRIPTION.toString());

String[] s=new String[1];
s[0]="123";
ConditionExpression[] condition = new ConditionExpression[1];
condition[0] = ConditionExpression.Factory.newInstance();
condition[0].setAttributeName("dslnumber");
condition[0].setOperator(ConditionOperator.EQUAL);
ArrayOfStringValue arr=ArrayOfStringValue.Factory.newInstance();

// arr.set
//arr.setValueArray(1, "123");
arr.setValueArray(new String [] {"123"});
condition[0].setValues(arr);

FilterExpression filter = FilterExpression.Factory.newInstance();

ArrayOfConditionExpression arrCond = ArrayOfConditionExpression.Factory.newInstance();
arrCond.setConditionArray(condition);
filter.setConditions(arrCond);
Enum enm = Enum.forString("EQUAL");
filter.setFilterOperator(enm);
query.setCriteria(filter);

rm.setQuery(query);
rmd.setRetrieveMultiple(rm);

CrmAuthenticationTokenDocument catd = CrmAuthenticationTokenDocument.Factory.newInstance();
CrmAuthenticationToken token = CrmAuthenticationToken.Factory.newInstance();
token.setAuthenticationType(0);
token.setOrganizationName(orgName);
catd.setCrmAuthenticationToken(token);
boolean fetchNext = true;

System.out.println(rmd+"rmd");



while(fetchNext){
RetrieveMultipleResponseDocument rmrd = stub.retrieveMultiple(rmd,catd, null, null);
 
Richard Lavoie
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came accross that problem once, and fixed it using XmlString object from the org.apache.xmlbeans package. This solves your problem:




rashmi shivanna wrote:Hi ,
I tried that still i am getting axis error . i changed arrayofanytype arryaofstringvalue . can you please have look at my code . please .


query.setColumnSet(AllColumns.Factory.newInstance());
query.setEntityName(EntityName.NEW_RESIDENTIALSUBSCRIPTION.toString());

String[] s=new String[1];
s[0]="123";
ConditionExpression[] condition = new ConditionExpression[1];
condition[0] = ConditionExpression.Factory.newInstance();
condition[0].setAttributeName("dslnumber");
condition[0].setOperator(ConditionOperator.EQUAL);
ArrayOfStringValue arr=ArrayOfStringValue.Factory.newInstance();

// arr.set
//arr.setValueArray(1, "123");
arr.setValueArray(new String [] {"123"});
condition[0].setValues(arr);

FilterExpression filter = FilterExpression.Factory.newInstance();

ArrayOfConditionExpression arrCond = ArrayOfConditionExpression.Factory.newInstance();
arrCond.setConditionArray(condition);
filter.setConditions(arrCond);
Enum enm = Enum.forString("EQUAL");
filter.setFilterOperator(enm);
query.setCriteria(filter);

rm.setQuery(query);
rmd.setRetrieveMultiple(rm);

CrmAuthenticationTokenDocument catd = CrmAuthenticationTokenDocument.Factory.newInstance();
CrmAuthenticationToken token = CrmAuthenticationToken.Factory.newInstance();
token.setAuthenticationType(0);
token.setOrganizationName(orgName);
catd.setCrmAuthenticationToken(token);
boolean fetchNext = true;

System.out.println(rmd+"rmd");



while(fetchNext){
RetrieveMultipleResponseDocument rmrd = stub.retrieveMultiple(rmd,catd, null, null);

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic