Axis2/JAX-WS. How to transfer complex objects?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Axis2/JAX-WS. How to transfer complex objects?

Sergio
Hi.

I have a problem. We are using AXIS2/JAX-WS
How to transfer complex object ?
I have two classes: SearchCrit and SearchCritCondition in server side:

public class SearchCrit implements Serializable{

private SearchCritCondition[] conditions;

}
public class SearchCritCondition implements Serializable{
}

And stubs in client side:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "searchCrit", propOrder = {"searchCritConditions"})
public class SearchCrit implements Serializable
{
@XmlElement
protected List<SearchCritCondition> searchCritConditions;

}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SearchCritCondition")
public class SearchCritCondition implements Serializable{

}

When I try to execute client, I get an exception:
java javax.xml.ws.soap.SOAPFaultException: javax.xml.bind.UnmarshalExcept
ion: unexpected element (uri:"", local:"searchCritConditions"). Expected elements are (none)
java at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolExceptio
n(SOAP11Fault.java:178)
java at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createExceptio
n(SOAPFaultBuilder.java:111)
java at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(S
yncMethodHandler.java:108)
java at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(S
yncMethodHandler.java:78)
java at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.jav
a:107)

Can you help me understand?