[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-c-user
Subject:    Re: Deserialization of arrays of complex elements with nil members
From:       John Hawkins <HAWKINSJ () uk ! ibm ! com>
Date:       2005-02-10 8:42:14
Message-ID: OF0A5D916F.8681EC87-ON80256FA4.002F1810-80256FA4.002F6BFC () uk ! ibm ! com
[Download RAW message or body]

This is a multipart message in MIME format.
--=_alternative 002F3D9A80256FA4_=
Content-Type: text/plain; charset="US-ASCII"

It's good to open the JIRA :-)

If you could give us the WSDL and anything that you might think relevant 
i.e. if you an capture the wire msg (using TCPMonitor in axis.jar). Just 
attach them to the JIR.

cheers,
John.





Tim Bartley <tbartley@au1.ibm.com> 
10/02/2005 01:36
Please respond to
"Apache AXIS C User List"


To
axis-c-user@ws.apache.org
cc

Subject
Deserialization of arrays of complex elements with nil members







I am using Axis C++ on the client side. One of my operations returns an 
array of: 

typedef struct ComplexTag { 
        xsd__string value1; 
        xsd__string value2; 
        xsd__string value3; 
} Complex; 

typedef struct Complex_ArrayTag { 
        Complex** m_Array; 
        int m_Size; 
} Complex_Array; 

If one of the array elements has an empty value for the first value (don't 
know whether it's only the first member or whether the fact that it's an 
array is relevant but that's all I've observed) then all the members of 
the Complex with an empty first member are deserialized as NULL and all 
subsequenet elements of the array are ignored. 

The following body fragment illustrates the problem. If the array data is 
returned as (this is being generated by a WebSphere 5.1.1 hosted Web 
service if that's of any interest): 

<data> 
        <value1>1 - value1</value1> 
        <value2>1 - value2</value2> 
        <value3>1 - value3</value3> 
</data> 
<data> 
        <value1/> 
        <value2>2 - value2</value2> 
        <value3>2 - value2</value3> 
</data> 
<data> 
        <value1>3 - value1</value1> 
        <value2>3 - value2</value2> 
        <value3>3 - value3</value3> 
</data> 

Then Axis C++ deserializes the array to me as: 

Complex_Array array; 
array.m_Size == 2 
*array.m_Array[0] == { "1 - value1", "1 - value2", "1 - value3" } 
*array.m_Array[1] == { NULL, NULL, NULL } 

Where I would expect: 

array.m_Size == 3 
*array.m_Array[0] == { "1 - value1", "1 - value2", "1 - value3" } 
*array.m_Array[1] == { NULL,         "2 - value2", "2 - value3" } 
*array.m_Array[2] == { "3 - value1", "3 - value2", "3 - value3" } 

I have only tried this with the 1.5 alpha release on Linux. 

Not sure what the etiquette is but I've also opened this as bug 
AXISCPP-418. 

Thanks and regards, 

Tim Bartley
--
IBM Tivoli Access Manager Development
Gold Coast Development Lab, Australia
+61-7-5552-4001 phone
+61-7-5571-0420 fax

--=_alternative 002F3D9A80256FA4_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">It's good to open the JIRA :-)</font>
<br>
<br><font size=2 face="sans-serif">If you could give us the WSDL and anything
that you might think relevant i.e. if you an capture the wire msg (using
TCPMonitor in axis.jar). Just attach them to the JIR.</font>
<br>
<br><font size=2 face="sans-serif">cheers,</font>
<br><font size=2 face="sans-serif">John.</font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Tim Bartley \
&lt;tbartley@au1.ibm.com&gt;</b> </font>
<p><font size=1 face="sans-serif">10/02/2005 01:36</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
&quot;Apache AXIS C User List&quot;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">axis-c-user@ws.apache.org</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Deserialization of arrays
of complex elements with nil members</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
I am using Axis C++ on the client side. One of my operations returns an
array of:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
typedef struct ComplexTag {</font><font size=3> </font><font size=2 \
face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; &nbsp;xsd__string value1;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; \
&nbsp;xsd__string value2;</font><font size=3> </font><font size=2 \
face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; &nbsp;xsd__string value3;</font><font \
size=3> </font><font size=2 face="sans-serif"><br> } Complex;</font><font size=3> \
<br> </font><font size=2 face="sans-serif"><br>
typedef struct Complex_ArrayTag {</font><font size=3> </font><font size=2 \
face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; &nbsp;Complex** m_Array;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; &nbsp;int \
m_Size;</font><font size=3> </font><font size=2 face="sans-serif"><br> } \
Complex_Array;</font><font size=3> <br> </font><font size=2 face="sans-serif"><br>
If one of the array elements has an empty value for the first value (don't
know whether it's only the first member or whether the fact that it's an
array is relevant but that's all I've observed) then all the members of
the Complex with an empty first member are deserialized as NULL and all
subsequenet elements of the array are ignored.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
The following body fragment illustrates the problem. If the array data
is returned as (this is being generated by a WebSphere 5.1.1 hosted Web
service if that's of any interest):</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
&lt;data&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value1&gt;1 - value1&lt;/value1&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value2&gt;1 - value2&lt;/value2&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value3&gt;1 - value3&lt;/value3&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
&lt;/data&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
&lt;data&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value1/&gt;</font><font size=3> </font><font size=2 \
face="sans-serif"><br>  &nbsp; &nbsp; &nbsp; &nbsp;&lt;value2&gt;2 - \
value2&lt;/value2&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value3&gt;2 - value2&lt;/value3&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
&lt;/data&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
&lt;data&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value1&gt;3 - value1&lt;/value1&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value2&gt;3 - value2&lt;/value2&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;value3&gt;3 - value3&lt;/value3&gt;</font><font \
size=3> </font><font size=2 face="sans-serif"><br>
&lt;/data&gt;</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Then Axis C++ deserializes the array to me as:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Complex_Array array;</font><font size=3> </font><font size=2 face="sans-serif"><br>
array.m_Size == 2</font><font size=3> </font><font size=2 face="sans-serif"><br>
*array.m_Array[0] == { &quot;1 - value1&quot;, &quot;1 - value2&quot;,
&quot;1 - value3&quot; }</font><font size=3> </font><font size=2 \
                face="sans-serif"><br>
*array.m_Array[1] == { NULL, NULL, NULL }</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Where I would expect:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
array.m_Size == 3</font><font size=3> </font><font size=2 face="sans-serif"><br>
*array.m_Array[0] == { &quot;1 - value1&quot;, &quot;1 - value2&quot;,
&quot;1 - value3&quot; }</font><font size=3> </font><font size=2 \
                face="sans-serif"><br>
*array.m_Array[1] == { NULL, &nbsp; &nbsp; &nbsp; &nbsp; &quot;2 - value2&quot;,
&quot;2 - value3&quot; }</font><font size=3> </font><font size=2 \
                face="sans-serif"><br>
*array.m_Array[2] == { &quot;3 - value1&quot;, &quot;3 - value2&quot;,
&quot;3 - value3&quot; }</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
I have only tried this with the 1.5 alpha release on Linux.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
Not sure what the etiquette is but I've also opened this as bug \
AXISCPP-418.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Thanks and regards,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Tim Bartley<br>
--<br>
IBM Tivoli Access Manager Development<br>
Gold Coast Development Lab, Australia<br>
+61-7-5552-4001 phone<br>
+61-7-5571-0420 fax</font>
<br>
--=_alternative 002F3D9A80256FA4_=--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic