Details
-
Bug
-
Status: Closed
-
Resolution: Cannot Reproduce
-
1.0 Final
-
None
-
Operating System: Other
Platform: Other
-
26274
Description
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).