aspose file tools*
The moose likes Web Services and the fly likes AXIS2 - set conditions - XmlValueDisconnectedException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "AXIS2 - set conditions - XmlValueDisconnectedException" Watch "AXIS2 - set conditions - XmlValueDisconnectedException" New topic
Author

AXIS2 - set conditions - XmlValueDisconnectedException

Lidija Sketa
Greenhorn

Joined: Nov 12, 2008
Posts: 26
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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Nov 12, 2008
Posts: 26
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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Jan 26, 2010
Posts: 1
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);

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AXIS2 - set conditions - XmlValueDisconnectedException