axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Wajsberg (JIRA)" <>
Subject [jira] Commented: (AXIS-1673) Problem with array of beans in 1.2RC2 (wrapped/literal)
Date Mon, 22 Nov 2004 16:13:26 GMT
     [ ]
Julien Wajsberg commented on AXIS-1673:

Quoted from the mailing list :

"I have encountered this same situation with .NET.  To fix the problem we had
to make the array property a Java Bean Indexed Property. Your ArrayBean
needs to have not only the simple getter and setter from simpleBeanArrayData
but also a getter and setter by index, getSimpleBeanArrayData(int i) and
setSimpleBeanArrayData(int i, SimpleBean bean).

This keeps Axis from generating the ArrayOf_ type (which is not valid based
on the WS-I spec)."

This workaround works perfectly. The WSDL is slightly different, for the description of ArrayBean

   <complexType name="ArrayBean">
     <element maxOccurs="unbounded" name="simpleBeanArrayData" nillable="true" type="tns1:SimpleBean"/>
     <element name="stringData" nillable="true" type="xsd:string"/>

Here, there isn't any wrapping element "item".

I think however that the initial behavior is a bug. I can think of two different correct behaviors
 - without this getter and setter, axis generates the same WSDL as this one
 - it should accept the SOAP message that is described in the generated WSDL

I tried implementing the service with beans without accessor, using the client to the other
service (therefore without "item" elements): the service accepted the message, but it wasn't
correctly deserialized (I only got one item in the array).

> Problem with array of beans in 1.2RC2 (wrapped/literal)
> -------------------------------------------------------
>          Key: AXIS-1673
>          URL:
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: Server : Windows 2000
> Client : Windows Xp
> JVM : Sun 1.4.2
>     Reporter: Julien Wajsberg
>     Priority: Critical

> There's a strange bug in axis 1.2RC2, dealing with array of beans.
> The signature of the called method is :
> public ArrayBean echoArrayBean(ArrayBean param);
> ArrayBean is defined like this :
> public class ArrayBean implements Serializable {
>    private String stringData;
>    private SimpleBean[] simpleBeanArrayData;
> ... accessors ...
> }
> And SimpleBean :
> public class SimpleBean implements Serializable {
>    private String stringData;
>    private int intData;
> ... accessors ...
> }
> The corresponding part of the WSDL generated by Axis follows (in different namespaces,
but we don't care here) :
>   <element name="echoArrayBean">
>    <complexType>
>     <sequence>
>      <element name="in0" type="tns1:ArrayBean"/>
>     </sequence>
>    </complexType>
>   </element>
>   <complexType name="ArrayOf_tns1_SimpleBean">
>    <sequence>
>     <element maxOccurs="unbounded" minOccurs="0" name="item" type="tns1:SimpleBean"/>
>    </sequence>
>   </complexType>
>   <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>
> What's important here is that "item" is correctly specified as an element of Array_Of_tns1_SimpleBean.
> When I try to invoke this operation with a Weblogic client, I get the following exception
> java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException:
Invalid element in test.bean.SimpleBean - item
> The corresponding part in the soap message is :
> <n1:echoArrayBean><n1:in0><n2:simpleBeanArrayData  xsi:type="n1:ArrayOf_tns1_SimpleBean">
> <n1:item xsi:type="n2:SimpleBean"><n2:intData>-123456</n2:intData><n2:stringData>ces
données sontcomplexes [à@}]</n2:stringData></n1:item>
> <n1:item xsi:type="n2:SimpleBean"><n2:intData>-123456</n2:intData><n2:stringData>ces
données sontcomplexes [à@}]</n2:stringData></n1:item>
> </n2:simpleBeanArrayData><n3:stringData>data</n3:stringData></n1:in0></n1:echoArrayBean>
> This message seems to be correct, according to the WSDL. Yet, Axis doesn't like it :/
> Note : we just tried with an Axis client: same soap message, same behaviour.
> -- 
> Julien Wajsberg

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message