I have a service which is using wrapped\literal style. The result of this
service is the array of complex type. When I am using rpc\encoded style
everything work good, but when I change to wrapped/literal I get
org.xml.sax.SAXException: Deserializing parameter 'searchJOfferReturn':
could not find deserializer for type {http://www.w3.org/2001/XMLSchema}any.
This is the code of rpc\encoded invokation:
JOffer[] result = null;
try {
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:BeanService", "Query" );
call.registerTypeMapping(Query.class, qn,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(Query.class, qn),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(Query.class, qn));
QName jOfferQName = new QName("http://office.jobbank","JOffer");
call.registerTypeMapping(JOffer.class,
jOfferQName,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(JOffer.class,jOfferQName),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(JOffer.class,jOfferQName));
call.setTargetEndpointAddress(
"http://localhost:8080/axis/services/OfficeService" );
call.setOperationName( "searchJOffer");
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_ANY);
result = (JOffer[])call.invoke(new Object[] { query });
}
and service wsdl:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://office.jobbank"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://office.jobbank" xmlns:intf="http://office.jobbank"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://broker.jobbank"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
- <wsdl:types>
- <schema targetNamespace="http://office.jobbank"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://broker.jobbank" />
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="JOffer">
- <sequence>
<element name="areasOfExpertise" nillable="true" type="xsd:string" />
<element name="company" nillable="true" type="xsd:string" />
<element name="description" nillable="true" type="xsd:string" />
<element name="education" nillable="true" type="xsd:string" />
<element name="id" nillable="true" type="xsd:long" />
</sequence>
</complexType>
- <complexType name="ArrayOfJOffer">
- <complexContent>
- <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:JOffer[]" />
</restriction>
</complexContent>
</complexType>
</schema>
- <schema targetNamespace="http://broker.jobbank"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://office.jobbank" />
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="Query">
- <sequence>
<element name="areasOfExpertise" nillable="true" type="xsd:string" />
<element name="education" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="updateJOfferRequest">
<wsdl:part name="in0" type="impl:JOffer" />
</wsdl:message>
- <wsdl:message name="publishJOfferResponse">
<wsdl:part name="publishJOfferReturn" type="xsd:long" />
</wsdl:message>
- <wsdl:message name="searchJOfferResponse">
<wsdl:part name="searchJOfferReturn" type="impl:ArrayOfJOffer" />
</wsdl:message>
- <wsdl:message name="updateJOfferResponse">
<wsdl:part name="updateJOfferReturn" type="xsd:boolean" />
</wsdl:message>
- <wsdl:message name="publishJOfferRequest">
<wsdl:part name="in0" type="impl:JOffer" />
</wsdl:message>
- <wsdl:message name="deleteJOfferRequest">
<wsdl:part name="in0" type="xsd:long" />
</wsdl:message>
- <wsdl:message name="deleteJOfferResponse">
<wsdl:part name="deleteJOfferReturn" type="xsd:boolean" />
</wsdl:message>
- <wsdl:message name="searchJOfferRequest">
<wsdl:part name="in0" type="tns1:Query" />
</wsdl:message>
- <wsdl:portType name="IOffice">
- <wsdl:operation name="publishJOffer" parameterOrder="in0">
<wsdl:input message="impl:publishJOfferRequest"
name="publishJOfferRequest" />
<wsdl:output message="impl:publishJOfferResponse"
name="publishJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="updateJOffer" parameterOrder="in0">
<wsdl:input message="impl:updateJOfferRequest" name="updateJOfferRequest"
/>
<wsdl:output message="impl:updateJOfferResponse"
name="updateJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="deleteJOffer" parameterOrder="in0">
<wsdl:input message="impl:deleteJOfferRequest" name="deleteJOfferRequest"
/>
<wsdl:output message="impl:deleteJOfferResponse"
name="deleteJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="searchJOffer" parameterOrder="in0">
<wsdl:input message="impl:searchJOfferRequest" name="searchJOfferRequest"
/>
<wsdl:output message="impl:searchJOfferResponse"
name="searchJOfferResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="OfficeServiceSoapBinding" type="impl:IOffice">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="publishJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="publishJOfferRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:input>
- <wsdl:output name="publishJOfferResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="updateJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="updateJOfferRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:input>
- <wsdl:output name="updateJOfferResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="deleteJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="deleteJOfferRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:input>
- <wsdl:output name="deleteJOfferResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="searchJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="searchJOfferRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:input>
- <wsdl:output name="searchJOfferResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://office.jobbank" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="IOfficeService">
- <wsdl:port binding="impl:OfficeServiceSoapBinding" name="OfficeService">
<wsdlsoap:address
location="http://localhost:8080/axis/services/OfficeService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
and here is the code of wrapped\literal:
JOffer[] result = null;
try {
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:BeanService", "Query" );
call.registerTypeMapping(Query.class, qn,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(Query.class, qn),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(Query.class, qn));
QName jOfferQName = new QName("http://office.jobbank","JOffer");
call.registerTypeMapping(JOffer.class,
jOfferQName,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(JOffer.class,jOfferQName),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(JOffer.class,jOfferQName));
call.setTargetEndpointAddress(
"http://localhost:8080/axis/services/OfficeService" );
call.setOperationName( "searchJOffer");
call.setOperationStyle("wrapped");
call.setOperationUse("literal");
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_ANY);
result = (JOffer[])call.invoke(new Object[] { query });
and wsdl for wrapped style:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://office.jobbank"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://office.jobbank" xmlns:intf="http://office.jobbank"
xmlns:tns1="http://broker.jobbank"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
- <wsdl:types>
- <schema elementFormDefault="qualified"
targetNamespace="http://office.jobbank"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://broker.jobbank" />
- <element name="publishJOffer">
- <complexType>
- <sequence>
<element name="in0" type="impl:JOffer" />
</sequence>
</complexType>
</element>
- <complexType name="ArrayOf_xsd_string">
- <sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"
/>
</sequence>
</complexType>
- <complexType name="JOffer">
- <sequence>
<element name="areasOfExpertise" nillable="true"
type="impl:ArrayOf_xsd_string" />
<element name="company" nillable="true" type="xsd:string" />
<element name="description" nillable="true" type="xsd:string" />
<element name="education" nillable="true" type="xsd:string" />
<element name="id" nillable="true" type="xsd:long" />
</sequence>
</complexType>
- <element name="publishJOfferResponse">
- <complexType>
- <sequence>
<element name="publishJOfferReturn" type="xsd:long" />
</sequence>
</complexType>
</element>
- <element name="updateJOffer">
- <complexType>
- <sequence>
<element name="in0" type="impl:JOffer" />
</sequence>
</complexType>
</element>
- <element name="updateJOfferResponse">
- <complexType>
- <sequence>
<element name="updateJOfferReturn" type="xsd:boolean" />
</sequence>
</complexType>
</element>
- <element name="deleteJOffer">
- <complexType>
- <sequence>
<element name="in0" type="xsd:long" />
</sequence>
</complexType>
</element>
- <element name="deleteJOfferResponse">
- <complexType>
- <sequence>
<element name="deleteJOfferReturn" type="xsd:boolean" />
</sequence>
</complexType>
</element>
- <element name="searchJOffer">
- <complexType>
- <sequence>
<element name="in0" type="tns1:Query" />
</sequence>
</complexType>
</element>
- <element name="searchJOfferResponse">
- <complexType>
- <sequence>
<element maxOccurs="unbounded" name="searchJOfferReturn"
type="impl:JOffer" />
</sequence>
</complexType>
</element>
</schema>
- <schema elementFormDefault="qualified"
targetNamespace="http://broker.jobbank"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://office.jobbank" />
- <complexType name="Query">
- <sequence>
<element name="areasOfExpertise" nillable="true"
type="impl:ArrayOf_xsd_string" />
<element name="education" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="updateJOfferRequest">
<wsdl:part element="impl:updateJOffer" name="parameters" />
</wsdl:message>
- <wsdl:message name="publishJOfferResponse">
<wsdl:part element="impl:publishJOfferResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="searchJOfferResponse">
<wsdl:part element="impl:searchJOfferResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateJOfferResponse">
<wsdl:part element="impl:updateJOfferResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="publishJOfferRequest">
<wsdl:part element="impl:publishJOffer" name="parameters" />
</wsdl:message>
- <wsdl:message name="deleteJOfferRequest">
<wsdl:part element="impl:deleteJOffer" name="parameters" />
</wsdl:message>
- <wsdl:message name="deleteJOfferResponse">
<wsdl:part element="impl:deleteJOfferResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="searchJOfferRequest">
<wsdl:part element="impl:searchJOffer" name="parameters" />
</wsdl:message>
- <wsdl:portType name="IOffice">
- <wsdl:operation name="publishJOffer">
<wsdl:input message="impl:publishJOfferRequest"
name="publishJOfferRequest" />
<wsdl:output message="impl:publishJOfferResponse"
name="publishJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="updateJOffer">
<wsdl:input message="impl:updateJOfferRequest" name="updateJOfferRequest"
/>
<wsdl:output message="impl:updateJOfferResponse"
name="updateJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="deleteJOffer">
<wsdl:input message="impl:deleteJOfferRequest" name="deleteJOfferRequest"
/>
<wsdl:output message="impl:deleteJOfferResponse"
name="deleteJOfferResponse" />
</wsdl:operation>
- <wsdl:operation name="searchJOffer">
<wsdl:input message="impl:searchJOfferRequest" name="searchJOfferRequest"
/>
<wsdl:output message="impl:searchJOfferResponse"
name="searchJOfferResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="OfficeServiceSoapBinding" type="impl:IOffice">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="publishJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="publishJOfferRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="publishJOfferResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="updateJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="updateJOfferRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="updateJOfferResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="deleteJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="deleteJOfferRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="deleteJOfferResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="searchJOffer">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="searchJOfferRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="searchJOfferResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="IOfficeService">
- <wsdl:port binding="impl:OfficeServiceSoapBinding" name="OfficeService">
<wsdlsoap:address
location="http://localhost:8080/axis/services/OfficeService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I saw this problems in another posts but i didn't manage to find answer.
Thanks,
Sergey
--
View this message in context:
http://www.nabble.com/-Axis2--Problem-with-getting-array-of-complex-type-in-wrapped-style.-tp14477535p14477535.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]