Hi,
and now, the second problem ! It's more like a problem with arrays.
We're still trying to expose, in RPC/Literal style, the following java class :
public class BusinessStructImpl { public String[] echoStringArray(String[] param) { return param; } public ArrayBean echoArrayBean(ArrayBean param) { return param; } }
ArrayBean has two attributes : stringData (a String) and an array of SimpleBean :
SimpleBean has only two attributes : intData (an int) and stringData (a String) with associated getters and setters.
At first, the following was in the automatically generated WSDD (by WSDL2Java, from Java2WSDL's WSDL):
<typeMapping xmlns:ns="urn:TestsAxis" qname="ns:ArrayOf_xsd_string" type="java:java.lang.String[]" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> <typeMapping xmlns:ns="urn:TestsAxis" qname="ns:ArrayOf_tns3_SimpleBean" type="java:com.bean.SimpleBean[]" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> <beanMapping xmlns:ns="http://bean.com" qname="ns:ArrayBean" languageSpecificType="java:com.bean.ArrayBean" /> <beanMapping xmlns:ns="http://bean.com" qname="ns:SimpleBean" languageSpecificType="java:com.bean.SimpleBean" />
With this WSDD, the WSDL generated from the servlet seems to be correct :
<complexType name="ArrayOf_xsd_string">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOf_tns1_SimpleBean">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item" type="tns1:SimpleBean"/>
</sequence>
</complexType>
and
<><complexType name="SimpleBean">
<sequence>
<element name="intData" type="xsd:int"/>
<element name="stringData" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayBean">
<sequence>
<element name="simpleBeanArrayData" nillable="true" type="impl:ArrayOf_tns1_SimpleBean"/>
<element name="stringData" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
But then, we get the following server-side exceptions, when trying to call the service (Weblogic client):
for echoStringArray :
javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
for echoBeanArray :
SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException: Invalid element in com.bean.SimpleBean - item
Questions :
1 - Why is there a SimpleDeserializer in the exception whereas we registered an ArraySerializer ? (I think I saw the same problem in another mail today)
2 - Why do we get an "invalid element exception", because it seems to be correct according to the WSDL ?
Thanks again !
Kind regards, -- Julien Wajsberg