Hi,
  I built a WebService client in C++ from stub emitted by the Axis
WSDL2Ws tool. However, when receiving the response from the Webservice,
the application aborts due to a Segmentation Fault.
  The fault takes place when deserializing the SOAP response. The SOAP
response is given below:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <soapenv:Body>
        <ns1:callSetupResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns1="http://www.abc.com/XXService/";>
                <callSetupResponse href="#id0"/>
        </ns1:callSetupResponse>
        <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns2:CallSetupResponseType"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns2="http://www.abc.com/XXService/";>
                <MaxDuration xsi:type="xsd:int">120</MaxDuration>
                <WhisperingSecs xsi:type="xsd:int">100</WhisperingSecs>
                <Criticality xsi:type="xsd:int">3</Criticality>
        </multiRef>
  </soapenv:Body>
</soapenv:Envelope>


On debugging, the 2nd line of the following method (emitted by WSDL2Ws)
was found to be causing the segmentation fault:

/*
 * This static method deserialize a CallSetupResponseType type of object
 */
int Axis_DeSerialize_CallSetupResponseType(CallSetupResponseType* param,
IWrapperSoapDeSerializer* pIWSDZ)
{
        xsd__int* p_MaxDuration =
(pIWSDZ->getElementAsInt("MaxDuration",0));
        /*
       * NOTE: p_MaxDuration value receives a value 0 (NULL). That's why
the      * line below gives a segmentation fault.        
         */     
        param->MaxDuration = *p_MaxDuration;                    
        delete p_MaxDuration;
        xsd__int* p_WhisperingSecs = 
                (pIWSDZ->getElementAsInt("WhisperingSecs",0));
        param->WhisperingSecs = *p_WhisperingSecs;
        delete p_WhisperingSecs;
        xsd__int* p_Criticality =
(pIWSDZ->getElementAsInt("Criticality",0));
        param->Criticality = *p_Criticality;
        delete p_Criticality;
        return pIWSDZ->getStatus();
}

Why is it that the MaxDuration value "120" cannot be deserialized to an
int? What could be going wrong? 

Can someone please help me about this?

Thanks in advance,
Arun



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to