axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert J. Blanchard" <bobby...@access4less.net>
Subject Re: Returning Structures Containing Arrays
Date Tue, 16 Nov 2004 13:21:43 GMT
Samisa...

Actually, I was doing a little sleuthing and found there is a problem in the
SoapDeSerializer.cpp file in the getBasicArray method.

When I looked this morning over at the axis-c-dev mailing list, it seems
someone else has reached the same conclusion:


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

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
13:59:12.000000000 +0100
@@ -726,10 +726,11 @@
     free(Array.m_Array);\
     Array.m_Array = 0;\
     Array.m_Size = 0;\
     return Array;\
 }\
+m_pNode = m_pParser->next(); /* skip end element node */\
 return Array;

 #define DESERIALIZE_LITERAL_ARRAY_BLOCK(cpp_type, conv_func) \
             Array.m_Array = malloc(sizeof(cpp_type)*INITIAL_ARRAY_SIZE);\
             if (!Array.m_Array) return Array;\
@@ -848,10 +849,11 @@
                     free(Array.m_Array);
                     Array.m_Array = 0;
                     Array.m_Size = 0;
                     return Array;
                 }
+                m_pNode = m_pParser->next(); /* skip end element node */
                 return Array;
             case XSD_UNSIGNEDINT:
                 DESERIALIZE_ENCODED_ARRAY_BLOCK(unsigned int, CONV_STRTOUL)
             case XSD_SHORT:
                 DESERIALIZE_ENCODED_ARRAY_BLOCK(short, CONV_STRTOL)

ENDQUOTE


I implemented the same change on my end, and now the code works correctly.
I would concur with Julien Lemoine that this is a necessary fix.

Thanks,
Rob



----- Original Message ----- 
From: "Samisa Abeysinghe" <samisa_abeysinghe@yahoo.com>
To: "Apache AXIS C User List" <axis-c-user@ws.apache.org>
Sent: Monday, November 15, 2004 8:16 PM
Subject: Re: Returning Structures Containing Arrays


> Hi Rob,
>     Do you have a WSDL for your service? If so please send it over to
recreate the situation along
> with the client/server code.
> Thanks,
> Samisa...
>
> --- Rob Blanchard <bobbybee@access4less.net> wrote:
>
> > Help!
> >
> > I'm trying to use Axis-C++ to create a client and server, where the
> > return from the server is a structure that contains an array and two
> > doubles.
> >
> > I have successfully been able to create a server that returns a
> > structure containing two doubles, or a server that returns an array.
> > But when I try to make a server that returns a more complicated
> > structure (containing an array), my client segfaults on me - it appears
> > to be some problem with the SoapDeSerializer function.  It seems to
> > parse out the array fine, but when it gets to the double, it returns an
> > AXIS_FAIL.
> >
> > Anyone have any ideas what I might be doing wrong, or what additional
> > information may be needed to solve this?
> >
> > Thanks,
> > Rob Blanchard



Mime
View raw message