Can you send your wsdl and response?
On 10/9/07, George H <[EMAIL PROTECTED]> wrote:
>
> I have created a webservice and client using the Axis2 eclipse
> plugin tools v1.3.0. Using Eclipse (J2EE) Version: 3.3.0 Build id:
> I20070621-1340.
> Axis2 v1.3
>
> I have a webservice with many methods. Some reaturn boolean some
> return an custom
> class serialized as an array of bytes. They all work, except for all the
> methods
> that have only 1 thing in common. They both return a Vector of that
> custom class.
> That vector is serialized into bytes and sent back like all the others,
> but it
> always fails with "Unexpected subelement return" error.
>
> The wsdl file is generated by the tools and so are the stub classes.
> Thanks in advance to anyone who can help me figure out the problem.
>
> The code calling the service
> ---
> Vector<CustomClass> customClasses = null;
>
> try {
> byte[] barray = serializeToBytes(myMessage);
> ByteArrayDataSource byteDataSource = new
> ByteArrayDataSource(barray);
> DataHandler dh = new DataHandler(byteDataSource);
>
> CoreServiceStub.GetCustomClasses getCustomClassesParam = new
> CoreServiceStub.GetCustomClasses();
> getCustomClassesParam.setCustomClass(dh);
>
> CoreServiceStub stub = new CoreServiceStub(TARGET_ENDPOINT);
> CoreServiceStub.GetCustomClassesResponse response =
> stub.getCustomClasses(getCustomClassesParam);
>
> DataHandler dh2 = response.get_return();
> Object obj = deserializeFromBytes(dh2);
> if(obj instanceof Vector) {
> customClasses = (Vector<CustomClass>)obj;
> }
> }
> catch(Exception ex) {
> ex.printStackTrace();
> }
>
>
>
> The stack trace, identical each time it is run.
> ---
> org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException:
> Unexpected subelement return
> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
> at serv.core.ws.CoreServiceStub.fromOM(CoreServiceStub.java:10032)
> at serv.core.ws.CoreServiceStub.getCustomClasses(
> CoreServiceStub.java:675)
> at
> serv.core.client.CoreServiceClient.getCustomClasses.CoreServiceClient.java
> :403)
> at serv.core.client.CoreServiceClient.main(CoreServiceClient.java
> :583)
> Caused by: java.lang.Exception:
> org.apache.axis2.databinding.ADBException: Unexpected subelement
> return
> at
> serv.core.ws.CoreServiceStub$GetCustomClassesResponse$Factory.parse(
> CoreServiceStub.java:7156)
> at serv.core.ws.CoreServiceStub.fromOM(CoreServiceStub.java:9930)
> ... 3 more
> Caused by: org.apache.axis2.databinding.ADBException: Unexpected
> subelement return
> at
> serv.core.ws.CoreServiceStub$GetCustomClassesResponse$Factory.parse(
> CoreServiceStub.java:7152)
> ... 4 more
> --
> George H
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Amila Suriarachchi,
WSO2 Inc.