[ 
http://issues.apache.org/jira/browse/AXISCPP-418?page=comments#action_59756 ]
     
Dushshantha Chandradasa commented on AXISCPP-418:
-------------------------------------------------

I tested this with axis c++ client side with Complex2.wsdl. 

The client can deserialize the NULL elemens correctly after some small 
modifications to the generated code.

The server response is as follows..

HTTP/1.1 200 OK

Date: Fri, 25 Feb 2005 08:26:25 GMT

Server: Apache/2.0.52 (Win32)

Content-Length: 831

Content-Type: text/xml



<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<SOAP-ENV:Body>
<ns1:getAllResponse xmlns:ns1="http://test";>
<getAllReturn><ns1:result>3</ns1:result>
<ns1:Complex_Ref><ns1:value1>1 - value1</ns1:value1>
<ns1:value2>1 - value2</ns1:value2>
<ns1:value3>1 - value3</ns1:value3>
</ns1:Complex_Ref><ns1:Complex_Ref><ns1:value1 xsi:nil="true"></ns1:value1>
<ns1:value2>2 - value2</ns1:value2>
<ns1:value3>2 - value3</ns1:value3>
</ns1:Complex_Ref><ns1:Complex_Ref><ns1:value1>3 - value1</ns1:value1>
<ns1:value2>3 - value2</ns1:value2>
<ns1:value3>3 - value3</ns1:value3>
</ns1:Complex_Ref></getAllReturn>
</ns1:getAllResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The server cannot anderstand empty SOAPAction So I set the SOAPAction manually 
in the ComplexStore.cpp of Client.

ComplexResult* ComplexStore::getAll()
{
        ComplexResult* pReturn = NULL;
        const char* pcCmplxFaultName;
        try
        {       if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) 
return pReturn;
        m_pCall->setTransportProperty(SOAPACTION_HEADER , 
"ComplexStoreService#getAll");
        
After this modification, i got some garbage values instead of 
Complex_Ref.m_Array[] elements.

Calling the Service...
x&#9786;2  x&#9786;2  �&#9786;2
x&#9786;2  x&#9786;2  �&#9786;2

This was because the generated code of ComplexStore.cpp of Client tries to 
deserialize "Complex" rather than a "Complex_Ref" sending from the server.

int Axis_DeSerialize_ComplexResult(ComplexResult* param, 
IWrapperSoapDeSerializer* pIWSDZ)
{
        Axis_Array array;

        param->result = *(pIWSDZ->getElementAsInt( "result",0));
        array = pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_Complex,
                                                                  
(void*)Axis_Create_Complex,
                                                                  
(void*)Axis_Delete_Complex,
                                                                  
(void*)Axis_GetSize_Complex,
                                                                  "Complex", 
Axis_URI_Complex);

After setting this to "Complex_Ref" i managed to get the expected output fron 
the Client.

Calling the Service...
1 - value1  1 - value2  1 - value3
2 - value2  2 - value3
3 - value1  3 - value2  3 - value3




> Deserialization of arrays of complex elements with nil members
> --------------------------------------------------------------
>
>          Key: AXISCPP-418
>          URL: http://issues.apache.org/jira/browse/AXISCPP-418
>      Project: Axis-C++
>         Type: Bug
>   Components: Deserialization
>     Versions: 1.5 Alpha
>  Environment: x86 SuSE SELS-8.1 service pack 3
>     Reporter: Tim Bartley
>     Assignee: Samisa Abeysinghe
>  Attachments: Complex2.wsdl, ComplexStore.wsdl, axis.trace, axis2.trace
>
> 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.
> Regards,
> Tim Bartley

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to