You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org> on 2004/11/24 00:36:29 UTC

[jira] Resolved: (AXIS-1464) Wrong arrays deserialisation (all elements equal to each other)

     [ http://nagoya.apache.org/jira/browse/AXIS-1464?page=history ]
     
Davanum Srinivas resolved AXIS-1464:
------------------------------------

    Resolution: Fixed

Checked in variation of the patch. Please cross-check.

thanks,
dims

> Wrong arrays deserialisation (all elements equal to each other)
> ---------------------------------------------------------------
>
>          Key: AXIS-1464
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1464
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2 Beta
>  Environment: java 1.4 / Win 2000
>     Reporter: An Tin
>     Priority: Critical

>
> 1) Modify example Address Book (folder samples\addr in standard destribution.
> File AddressBook.wsdl :
> Add elements : 
>      <xsd:complexType name="persone">
>       <xsd:attribute name="firstname" type="xsd:string"/>
>       <xsd:attribute name="name" type="xsd:string"/>
>      </xsd:complexType>
>      <xsd:complexType name="persone_list">
>       <xsd:sequence>
>         <xsd:element name="persone" type="typens:persone" minOccurs="0" maxOccurs="unbounded"/>
>       </xsd:sequence>
>      </xsd:complexType>
> Modify element :
>       <xsd:complexType name="address">
>         <xsd:all>
>             <xsd:element name="streetNum" type="xsd:int"/>
>             <xsd:element name="streetName" type="xsd:string"/>
>             <xsd:element name="city" type="xsd:string"/>
>             <xsd:element name="state" type="typens:stateType"/>
>             <xsd:element name="zip" type="xsd:int"/>
>             <xsd:element name="phoneNumber" type="typens:phone"/>
>             <xsd:element name="persone_list" type="typens:persone_list" minOccurs="0" maxOccurs="1" />
>         </xsd:all>
>       </xsd:complexType>
> File Main.java : in section STATIC add Object "Persone_list" with 2 objects "Persone" inside (line 58)
>         Persone p1= new Persone();
>          p1.setFirstname("111");
>          p1.setName("N 111");
>          Persone p2= new Persone();
>           p2.setFirstname("222");
>           p2.setName("N 222");
>         Persone_list pl = new Persone_list();
>           pl.setPersone(new Persone[]{p1,p2});
>         addr1.setPersone_list(pl);
> Change method "printAddress" to print also object "Persone_list" :
>  Persone_list pl = ad.getPersone_list();
>         for(int i=0;i<pl.getPersone().length;i++){
>          System.out.println("Persone "+i+" : "+pl.getPersone()[i].getFirstname());
>         }
> 2) Run the example . 
>    There are 2 elements "Persone" inside of "Persone_list" on client side. We send these objects to server and get tham back.
> (!!!) Instead of 2 different objects there are in array 2 copies of the the second object. 
> So output for this test we have for objects "Persone":
> Persone 0 : 222
> Persone 1 : 222
> Must be :
> Persone 0 : 111
> Persone 1 : 222 
> 3) This bug is stable. I found it ini another application and modifyed example application to demonstrate it. 
> 4) Problem happens during deserialisation as I found out by printing objects in client and server sides as XML.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira