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 Ju...@fr.thalesgroup.com on 2004/11/15 14:26:29 UTC

[AXIS C++ 1.3] Bug in SoapDeSerializer::getBasicArray when there is more than one array

Hello,
	I created a small webservice application with multiple arrays, here
is the fragment of the wsdl file :

      <xsd:complexType name="TestMsg">
        <xsd:sequence>
          <xsd:element type="xsd:int" minOccurs="1"
	               maxOccurs="unbounded" name="docs"/>
          <xsd:element type="xsd:string" minOccurs="1"
	               maxOccurs="unbounded" name="tags"/>
	</xsd:sequence>
      </xsd:complexType>

and here is a sample of the client query :
<TestMsg xsi:type="ns2:TestMsg"
         xmlns:ns2="http://localhost:4242/axis/Test/xsd">
  <docsArray xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
             enc:arrayType="xsd:int[5]">
    <item>15</item>
    <item>20</item>
    <item>25</item>
    <item>32</item>
    <item>39</item>
  </docsArray>
  <tagsArray xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
             ncc:arrayType="xsd:string[3]">
    <item>NomCommun</item>
    <item>NomPropre</item>
    <item>Verbe</item>
  </tagsArray>
</TestMsg>

Using axis-c 1.3, I could not get these two vectors, I could get only
one of them.
After some investigation, I found that
SoapDeSerializer::getBasicArray() always get the first next node and after
some
debug, I discovered that the next node was </docsArray> which failed in all
cases.

In order to get the next node not null, I patch the method :
--- axis-c-src-1-3-linux/src/soap/SoapDeSerializer.cpp  2004-10-22
14:50:49.000000000 +0200
+++ axis-c-src-1-3-linux.modif/src/soap/SoapDeSerializer.cpp    2004-11-15
11:59:55.000000000 +0100
@@ -811,10 +811,13 @@
     if (AXIS_SUCCESS != m_nStatus) return Array;
     /* if anything has gone wrong earlier just do nothing */
     if (RPC_ENCODED == m_nStyle)
     {
         m_pNode = m_pParser->next();
+       while (m_pNode && !getArraySize(m_pNode))
+         m_pNode = m_pParser->next();
+
         /* just skip wrapper node with type info  Ex:
<tns:ArrayOfPhoneNumbers
          * xmlns:tns="http://www.getquote.org/test">
          */ 
         if (!m_pNode) return Array;
         Array.m_Size = getArraySize(m_pNode);


I am not familiar with axis code, so I am not sure that this is the
best way to fix this problem. If necessary, I can fill a bug report using
JIRA.

Best Regards.

-- 
Julien Lemoine