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 bu...@apache.org on 2004/01/20 11:55:49 UTC

DO NOT REPLY [Bug 26274] New: - nested array -> deserialization fails

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26274

nested array -> deserialization fails

           Summary: nested array -> deserialization fails
           Product: Axis-C++
           Version: 1.0 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: roland.kosovsky@abacus.ch


I have something like the following code and want to serialize an object of type
"FindResult" (stl syntax is just for easier understanding).

struct Row {
  string syskey;
  vector<string> fieldValues;
};
struct FindResult {
  int status3;
  string errorMsg3;
  vector<Row> rows;
};

Therefore my WSDL looks like this:

<xsd:complexType name="Row">
 <xsd:all>
  <xsd:element name="syskey" type="xsd:string"/>
  <xsd:element name="fieldValues" type="impl:FieldArray"/>
 </xsd:all>
</xsd:complexType>

<xsd:complexType name="RowArray">
 <xsd:complexContent>
  <xsd:restriction base="soapenc:Array">
  <xsd:attribute ref="soapenc:arrayType" arrayType="impl:Row[]"/>
 </xsd:restriction>
</xsd:complexContent>

</xsd:complexType>
 <xsd:complexType name="FindResult">
  <xsd:all>        
   <xsd:element name="status3" type="xsd:int"/>
   <xsd:element name="errorMsg3" type="xsd:string"/>
   <xsd:element name="rows" type="impl:RowArray"/>
  </xsd:all>
</xsd:complexType>


What I get on the client side looks like this (3 rows, 10 fields):
1
errorMsg
(MyKey100) 0/0;0/1;0/2;0/3;0/4;0/5;0/6;0/7;0/8;0/9;;MyKey101;;;;;;;;;;;;;;;;;;;
(1/1) 
(1/4) 

What I would expect is:
1
errorMsg
(MyKey100) 0/0;0/1;0/2;0/3;0/4;0/5;0/6;0/7;0/8;0/9;
(MyKey101) 1/0;1/1;1/2;1/3;1/4;1/5;1/6;1/7;1/8;1/9;
(MyKey102) 2/0;2/1;2/2;2/3;2/4;2/5;2/6;2/7;2/8;2/9;

The first nested array gets 30 elements instead of 10, the other rows stay empty. 

Resolution: arraybean.cpp, Ln 183
int ArrayBean::GetArrayBlockSize(list<int>::iterator it)
{
  return m_size.back();  // replaces old code
}

The old code always calculates the size of a 2 dimensional array (in my case
3*10=30) instead of the current array size (10).