Hi all,
first of all I'd like to apologize for the length of this message, but I need help
before becaming crazy.
The fact is I'm developing a web service wich receives a bean like the one belllow :
public class Shop implements java.io.Serializable {
private java.lang.String description;
private java.lang.String name;
private com.comercia.mall.ws.Section[] sections;
public Shop() {
}
.....
// getters and setters
}
I've used java2WSDL and WSDL2Java to generate both stubs and skeletons.
The wsdd I get looks like this one :
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<!-- Services from MallWSService WSDL service -->
<service name="MallWS" provider="java:RPC" style="rpc" use="literal">
<parameter name="wsdlTargetNamespace" value="urn:MallWS"/>
<parameter name="wsdlServiceElement" value="MallWSService"/>
<parameter name="wsdlServicePort" value="MallWS"/>
<parameter name="className"
value="com.comercia.mall.ws.MallWSSoapBindingSkeleton"/>
<parameter name="wsdlPortType" value="MallWS"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="scope" value="Request"/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:XtraAttribute"
type="java:com.comercia.mall.ws.XtraAttribute"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:Section"
type="java:com.comercia.mall.ws.Section"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:ArrayOfProduct"
type="java:com.comercia.mall.ws.Product[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:Product"
type="java:com.comercia.mall.ws.Product"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:ArrayOfXtraAttribute"
type="java:com.comercia.mall.ws.XtraAttribute[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:Shop"
type="java:com.comercia.mall.ws.Shop"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:Catalog"
type="java:com.comercia.mall.ws.Catalog"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
<typeMapping
xmlns:ns="urn:MallWS"
qname="ns:ArrayOfSection"
type="java:com.comercia.mall.ws.Section[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle=""
/>
</service>
</deployment>
When I use the stub to invoke one of the methods, wich takes a Shop bean as parameter,
using SOAP monitor I figure out the next surprise :
<in0 xmlns="">
<description xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<name xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<sections xmlns:ns1="urn:MallWS">
<description>Descripci�n de la secci�n 1</description>
<name>seccion 1</name>
</sections>
<sections>
<description>Descripci�n de la secci�n 2</description>
<name>seccion 2</name>
</sections>
</in0>
</notifyShopStructure>
Like you can appreciate, Section [] is not properly serialized. This causes that
deserialization only takes the first of the two sections.
Why Section [] is not serialized this way ?
<sections>
<section>
<description>Descripci�n de la secci�n 1</description>
<name>seccion 1</name>
</section>
<section>
<description>Descripci�n de la secci�n 2</description>
<name>seccion 2</name>
</section>
</sections>
Maybe I'm doing something wrong, but I can't realize what it is.
Could it be that generated stubs doesn't work properly?
Well, thanks in advance. Any help will be very,very appreciated.
Thanks again.
Pablo.