axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <>
Subject Few questions on values returned to Stubs
Date Tue, 07 Sep 2004 03:54:13 GMT
Hi All,
   I have few doubts to clarify regarding the values reurned by the generated code.

   I will use the 'base' sample to explain my questions.

1. The generated code has a method with signature:
    SOAPStruct* echoStruct(SOAPStruct* Value0);
SOAPStruct here is a class. My question is that will the generated code always return a pointer
case of returning class objects. In other words, is it possible to return an object by value
a method call?

2. The SOAPStruct class has a member with the signature:
    xsd__string varString;
Here xsd__string is basically char* and destructor uses malloc to allocate memory for this
However destructor of SOAPStruct class does not release the varString member.
Hence in the user written code, I have to release the varString member explicitly.
    SOAPStruct* stctResult = ws.echoStruct (&stct);
    // Do stuff
    // clean memory
Can we update the code generation tool to clean up char* members from class destructor? Is
any specific reason not to do this?

3. As I mentioned in an earlier email, in case of arrays, the generated code use stucts
typedef struct SOAPStruct_ArrayTag
        SOAPStruct* m_Array;
        int m_Size;
} SOAPStruct_Array;

Arrays are returned by value.
    SOAPStruct_Array echoStructArray(SOAPStruct_Array Value0);
  3.1 In case of array structs, do we always retun by value? In other words, is it possible
the generated code return a pointer to an array struct? Also why are we not returning a pointer
case of array struct?

  3.2 In this case I have to use the assignment operator to hold the return value
    SOAPStruct_Array arrstctResult = ws.echoStructArray (arrstct);
      Is this syntax correct? 

  3.3 When I look in the generated code for echo array of struct I see the following:
      RetArray = (SOAPStruct_Array&)m_pCall->getCmplxArray((void*) Axis_DeSerialize_SOAPStruct,
oid*) Axis_Create_SOAPStruct, (void*) Axis_Delete_SOAPStruct, (void*) Axis_GetSize_SOAPStruct,
"return", Axis_URI_SOAPStruct
      Here the getCmplxArray method of Call class returns an Axis_Array struct. And we cast
result to SOAPStruct_Array. (Note that they are structs and not classes. Hence there is no
inheritance here) How correct is this cast (casting one struct type to another)? It may work
it looks like therer is something wrong. Or am I missing something here?

Your help on this is highly appreciated.

Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!

View raw message