Re: Unexpected subelement return exception

2007-10-10 Thread Amila Suriarachchi
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
 ---
 VectorCustomClass 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 = (VectorCustomClass)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.


Re: Unexpected subelement return exception

2007-10-10 Thread George H
Thank you for your response.

Below is my WSDL file (I cut out the parts not dealing with my 2
problematic methods.
Below that is the SOAP response. I think that is what you wanted? I
set the log4j properties to DEBUG on the client side and dumped the
output.

Thank you.

WSDL
-
?xml version=1.0 encoding=UTF-8?
wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
xmlns:axis2=http://ws.core.serv;
xmlns:ns1=http://org.apache.axis2/xsd;
xmlns:wsaw=http://www.w3.org/2006/05/addressing/wsdl;
xmlns:http=http://schemas.xmlsoap.org/wsdl/http/;
xmlns:ns0=http://ws.core.serv/xsd;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/;
targetNamespace=http://ws.core.serv;
wsdl:types
xs:schema xmlns:xsd=http://ws.core.tipsws/xsd;
attributeFormDefault=qualified elementFormDefault=qualified
targetNamespace=http://ws.core.serv/xsd;
xs:element name=getCustomClasses
xs:complexType
xs:sequence
xs:element minOccurs=0
name=GenericStructMessage nillable=true type=xs:base64Binary/
/xs:sequence
/xs:complexType
/xs:element
xs:element name=getCustomClassesResponse
xs:complexType
xs:sequence
xs:element minOccurs=0 name=return
nillable=true type=xs:base64Binary/
/xs:sequence
/xs:complexType
/xs:element
xs:element name=getOtherCustomClasses
xs:complexType
xs:sequence
xs:element minOccurs=0 name=GenericStruct
nillable=true type=xs:base64Binary/
/xs:sequence
/xs:complexType
/xs:element
xs:element name=getOtherCustomClassesResponse
xs:complexType
xs:sequence
xs:element minOccurs=0 name=return
nillable=true type=xs:base64Binary/
/xs:sequence
/xs:complexType
/xs:element
/xs:schema
/wsdl:types
wsdl:message name=getOtherCustomClassesRequest
wsdl:part name=parameters element=ns0:getOtherCustomClasses/
/wsdl:message
wsdl:message name=getOtherCustomClassesResponse
wsdl:part name=parameters
element=ns0:getOtherCustomClassesResponse/
/wsdl:message
wsdl:message name=getCustomClassesRequest
wsdl:part name=parameters element=ns0:getCustomClasses/
/wsdl:message
wsdl:message name=getCustomClassesResponse
wsdl:part name=parameters element=ns0:getCustomClassesResponse/
/wsdl:message
wsdl:portType name=CoreServicePortType
wsdl:operation name=getOtherCustomClasses
wsdl:input message=axis2:getOtherCustomClassesRequest
wsaw:Action=urn:getOtherCustomClasses/
wsdl:output message=axis2:getOtherCustomClassesResponse
wsaw:Action=urn:getOtherCustomClassesResponse/
/wsdl:operation
wsdl:operation name=getCustomClasses
wsdl:input message=axis2:getCustomClassesRequest
wsaw:Action=urn:getCustomClasses/
wsdl:output message=axis2:getCustomClassesResponse
wsaw:Action=urn:getCustomClassesResponse/
/wsdl:operation
/wsdl:portType
wsdl:binding name=CoreServiceSOAP11Binding
type=axis2:CoreServicePortType
soap:binding transport=http://schemas.xmlsoap.org/soap/http;
style=document/
wsdl:operation name=getOtherCustomClasses
soap:operation soapAction=urn:getOtherCustomClasses
style=document/
wsdl:input
soap:body use=literal/
/wsdl:input
wsdl:output
soap:body use=literal/
/wsdl:output
/wsdl:operation
wsdl:operation name=getCustomClasses
soap:operation soapAction=urn:getCustomClasses style=document/
wsdl:input
soap:body use=literal/
/wsdl:input
wsdl:output
soap:body use=literal/
/wsdl:output
/wsdl:operation
/wsdl:binding
wsdl:binding name=CoreServiceSOAP12Binding
type=axis2:CoreServicePortType
soap12:binding
transport=http://schemas.xmlsoap.org/soap/http; style=document/
wsdl:operation name=getOtherCustomClasses
soap12:operation soapAction=urn:getOtherCustomClasses
style=document/
wsdl:input
soap12:body use=literal/
/wsdl:input
wsdl:output
soap12:body use=literal/
/wsdl:output
/wsdl:operation
wsdl:operation name=getCustomClasses
soap12:operation soapAction=urn:getCustomClasses
style=document/
wsdl:input
soap12:body use=literal/
/wsdl:input
wsdl:output

Re: Unexpected subelement return exception

2007-10-10 Thread Amila Suriarachchi
I need the response soap envelop.
you can use [1] to capture the request and the response.
basically check whether your reponse is match to your schema.


[1] http://ws.apache.org/commons/tcpmon/

Amila.

On 10/10/07, George H [EMAIL PROTECTED] wrote:

 Thank you for your response.

 Below is my WSDL file (I cut out the parts not dealing with my 2
 problematic methods.
 Below that is the SOAP response. I think that is what you wanted? I
 set the log4j properties to DEBUG on the client side and dumped the
 output.

 Thank you.

 WSDL
 -
 ?xml version=1.0 encoding=UTF-8?
 wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
 xmlns:axis2=http://ws.core.serv;
 xmlns:ns1=http://org.apache.axis2/xsd;
 xmlns:wsaw=http://www.w3.org/2006/05/addressing/wsdl;
 xmlns:http=http://schemas.xmlsoap.org/wsdl/http/;
 xmlns:ns0=http://ws.core.serv/xsd;
 xmlns:xs=http://www.w3.org/2001/XMLSchema;
 xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
 xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
 xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/;
 targetNamespace=http://ws.core.serv;
 wsdl:types
 xs:schema xmlns:xsd=http://ws.core.tipsws/xsd;
 attributeFormDefault=qualified elementFormDefault=qualified
 targetNamespace=http://ws.core.serv/xsd;
 xs:element name=getCustomClasses
 xs:complexType
 xs:sequence
 xs:element minOccurs=0
 name=GenericStructMessage nillable=true type=xs:base64Binary/
 /xs:sequence
 /xs:complexType
 /xs:element
 xs:element name=getCustomClassesResponse
 xs:complexType
 xs:sequence
 xs:element minOccurs=0 name=return
 nillable=true type=xs:base64Binary/
 /xs:sequence
 /xs:complexType
 /xs:element
 xs:element name=getOtherCustomClasses
 xs:complexType
 xs:sequence
 xs:element minOccurs=0 name=GenericStruct
 nillable=true type=xs:base64Binary/
 /xs:sequence
 /xs:complexType
 /xs:element
 xs:element name=getOtherCustomClassesResponse
 xs:complexType
 xs:sequence
 xs:element minOccurs=0 name=return
 nillable=true type=xs:base64Binary/
 /xs:sequence
 /xs:complexType
 /xs:element
 /xs:schema
 /wsdl:types
 wsdl:message name=getOtherCustomClassesRequest
 wsdl:part name=parameters element=ns0:getOtherCustomClasses/
 /wsdl:message
 wsdl:message name=getOtherCustomClassesResponse
 wsdl:part name=parameters
 element=ns0:getOtherCustomClassesResponse/
 /wsdl:message
 wsdl:message name=getCustomClassesRequest
 wsdl:part name=parameters element=ns0:getCustomClasses/
 /wsdl:message
 wsdl:message name=getCustomClassesResponse
 wsdl:part name=parameters
 element=ns0:getCustomClassesResponse/
 /wsdl:message
 wsdl:portType name=CoreServicePortType
 wsdl:operation name=getOtherCustomClasses
 wsdl:input message=axis2:getOtherCustomClassesRequest
 wsaw:Action=urn:getOtherCustomClasses/
 wsdl:output message=axis2:getOtherCustomClassesResponse
 wsaw:Action=urn:getOtherCustomClassesResponse/
 /wsdl:operation
 wsdl:operation name=getCustomClasses
 wsdl:input message=axis2:getCustomClassesRequest
 wsaw:Action=urn:getCustomClasses/
 wsdl:output message=axis2:getCustomClassesResponse
 wsaw:Action=urn:getCustomClassesResponse/
 /wsdl:operation
 /wsdl:portType
 wsdl:binding name=CoreServiceSOAP11Binding
 type=axis2:CoreServicePortType
 soap:binding transport=http://schemas.xmlsoap.org/soap/http;
 style=document/
 wsdl:operation name=getOtherCustomClasses
 soap:operation soapAction=urn:getOtherCustomClasses
 style=document/
 wsdl:input
 soap:body use=literal/
 /wsdl:input
 wsdl:output
 soap:body use=literal/
 /wsdl:output
 /wsdl:operation
 wsdl:operation name=getCustomClasses
 soap:operation soapAction=urn:getCustomClasses
 style=document/
 wsdl:input
 soap:body use=literal/
 /wsdl:input
 wsdl:output
 soap:body use=literal/
 /wsdl:output
 /wsdl:operation
 /wsdl:binding
 wsdl:binding name=CoreServiceSOAP12Binding
 type=axis2:CoreServicePortType
 soap12:binding
 transport=http://schemas.xmlsoap.org/soap/http; style=document/
 wsdl:operation name=getOtherCustomClasses
 soap12:operation soapAction=urn:getOtherCustomClasses
 style=document/
 wsdl:input
 soap12:body use=literal/
 

Unexpected subelement return exception

2007-10-09 Thread George H
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
--- 
VectorCustomClass 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 = (VectorCustomClass)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]