I'm a newbie to Axis and SOAP, so please forbear with me: I'm currently working in project using gSOAP 2.2.3b as server and Axis 1.1 RC2 as client. I used the wsdl file generated by gSOAP and converted it using wsdl2java, but I ran into an problem with Axis not able to deserialize an array of complex type data.
The gSOAP wsdl file defines the following complex types:
...
<complexType name="Property"> <sequence> <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/> <element name="type" type="xsd:int" minOccurs="1" maxOccurs="1"/> <element name="value" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/> <element name="readOnly" type="xsd:boolean" minOccurs="1" maxOccurs="1"/> </sequence> </complexType>
<complexType name="ArrayOfProperty"> <complexContent> <restriction base="SOAP-ENC:Array"> <sequence> <element name="property" type="silva:Property" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="silva:Property[]"/> </restriction> </complexContent> </complexType>
<complexType name="Description"> <sequence> <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/> <element name="description" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/> <element name="id" type="xsd:int" minOccurs="1" maxOccurs="1"/> <element name="singletree" type="xsd:boolean" minOccurs="1" maxOccurs="1"/> <element name="modifying" type="xsd:boolean" minOccurs="1" maxOccurs="1"/> <element name="properties" type="silva:ArrayOfProperty" minOccurs="1" maxOccurs="1" nillable="true"/> </sequence> </complexType>
...
Additionally it defines an operation to return a description:
<operation name="getDescriptionAvailable"> <documentation>Returns the description for an available object.</documentation> <input message="tns:getDescriptionAvailableRequest"/> <output message="tns:getDescriptionAvailableResponse"/> </operation>
The only unresolved issue so far is that Axis throws an "no deserializer defined for array type Property" when it gets the follwing SOAP code:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:silva="urn:silvacpp"> <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <silva:getDescriptionAvailableResponse> <description> <name xsi:type="xsd:string">Erzeuger NeuerBestand</name> <description xsi:type="xsd:string">Eine Beschreibung</description> <id xsi:type="xsd:int">7007</id> <singletree xsi:type="xsd:boolean">true</singletree> <modifying xsi:type="xsd:boolean">false</modifying> <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Property[9]"> <property><name xsi:type="xsd:string">Key00</name> <type xsi:type="xsd:int">1</type> <value xsi:type="xsd:string">Baumart00</value> <readOnly xsi:type="xsd:boolean">false</readOnly> </property>
...
</properties> </description> </silva:getDescriptionAvailableResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I've also tried to get the property array from a seperate SOAP operation in order to avoid the nested array, but it had no effect. It still threw the same exception:
org.xml.sax.SAXException: No deserializer defined for array type Property at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304) at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:428) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:962) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:718) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:232) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:346) at org.apache.axis.client.Call.invoke(Call.java:2234) at org.apache.axis.client.Call.invoke(Call.java:2133) at org.apache.axis.client.Call.invoke(Call.java:1656) at silva.soap.Silva_wsdl.SilvaBindingStub.getDescriptionAvailableProperties(SilvaBindingStub.java:303) ...
As I haven't found much documentation or examples so far on arrays in Axis I would be very grateful if someone in this list could help me or at leat point out the right direction. On the list archive I read about similar exceptions being related to a bug (#15698). If so, is there a workaround? Hopefully, I posted everything you need to help me.
Thanks very much in advance Eric