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 ax...@ws.apache.org on 2004/07/21 08:11:40 UTC

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

The following comment has been added to this issue:

     Author: An Tin
    Created: Tue, 20 Jul 2004 11:11 PM
       Body:
Some more details : it looks like the problem conserns only ATTRIBUTES 
Here is new test :

 1) Modify example Address Book (folder samples\addr in standard destribution.

File AddressBook.wsdl :

Add element :

     <xsd:complexType name="persone">
      <xsd:sequence>
        <xsd:element name="text" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute name="firstname" type="xsd:string"/>
      <xsd:attribute name="name" type="xsd:string"/>
     </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" type="typens:persone" minOccurs="0" maxOccurs="unbounded" />

        </xsd:all>
      </xsd:complexType>

File Main.java : in section static{}


        Persone p1= new Persone();
         p1.setFirstname("111");
         p1.setName("N 111");
         p1.setText("T 111");

         Persone p2= new Persone();
          p2.setFirstname("222");
          p2.setName("N 222");
          p2.setText("T 222");

        addr1.setPersone(new Persone[]{p1,p2});


Change method "printAddress" to print also objects "Persone" :


        Persone[] pl = ad.getPersone();
        for(int i=0;i<pl.length;i++){
         System.out.println("Persone "+i+" : "+pl[i].getFirstname()+","+pl[i].getName()+","+pl[i].getText());
        }


2) Run the example .
   There are 2 elements "Persone" inside of "Address" on client side. We send these objects to server and get tham back.

(!!!) Both elements in array has the same attributes.

So in output for this test we have for objects "Persone":

Persone 0 : 111,N 111,T 111
Persone 1 : 111,N 111,T 222

Must be :

Persone 0 : 111,N 111,T 111
Persone 1 : 222,N 222,T 222


---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-1464?page=comments#action_36801

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1464

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1464
    Summary: Wrong arrays deserialisation (all elements equal to each other)
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Axis
 Components: 
             Serialization/Deserialization
   Versions:
             1.2 Beta

   Assignee: 
   Reporter: An Tin

    Created: Tue, 20 Jul 2004 1:53 AM
    Updated: Tue, 20 Jul 2004 11:11 PM
Environment: java 1.4 / Win 2000

Description:
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.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.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