axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hawkins <HAWKI...@uk.ibm.com>
Subject Re: Unexpected #includes within WSDL2Ws generated AxisClientException.h
Date Tue, 20 Jul 2004 14:41:22 GMT




Ohhh,

 is this documented somewhere?





John Hawkins




                                                                           
             nithya@opensource                                             
             .lk                                                           
                                                                        To 
             16/07/2004 06:07          "Apache AXIS C Developers List"     
                                       <axis-c-dev@ws.apache.org>          
                                                                        cc 
             Please respond to                                             
              "Apache AXIS C                                       Subject 
             Developers List"          Re: Unexpected #includes within     
                                       WSDL2Ws generated                   
                                       AxisClientException.h               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Adrian,

> However, looking through the rest of the AxisClientException code, there
> are no further references to the fault types.  Which, for me,  raises the
> further question - Why are we including the fault types, if they're not
> actually being used?

The fault types may be used by the user to extract the fault message in
the processException(ISoapFault* pFault).
For example in
$AXISCPP_HOME/tests/client/fault_mapping/gen_src/AxisClientException.cpp
-----------------------------------------------------------------
void AxisClientException::processException (ISoapFault* pFault)
{
        /*User can do something like deserializing the struct into a
string*/
        const char* pcCmplxFaultName;
        const char* pcDetail;
        if(pFault)
        {
            m_sMessage = "Fault Code:";
            m_sMessage += pFault->getFaultcode();
            m_sMessage += "\n";
            m_sMessage += "Fault String:";
            m_sMessage += pFault->getFaultstring();
            m_sMessage += "\n";
            m_sMessage += "Fault Actor:";
            m_sMessage += pFault->getFaultactor();
            m_sMessage += "\n";

            pcDetail = pFault->getSimpleFaultDetail().c_str();
            if(NULL != pcDetail && 0 != strcmp("", pcDetail))
                m_sMessage += pcDetail;
            else
            {
pcCmplxFaultName = pFault->getCmplxFaultObjectName().c_str();
                //printf("pcCmplxFaultName:%s\n", pcCmplxFaultName);
            }
            if(0 == strcmp("OutOfBoundStruct", pcCmplxFaultName))
            {
                OutOfBoundStruct* pFaultDetail = NULL;
                pFaultDetail = (OutOfBoundStruct*)pFault->
                    getCmplxFaultObject();
                SpecialDetailStruct* pSpecialFaultDetail =
pFaultDetail->specialDetail;

                m_sMessage += pFaultDetail->varString;
                m_sMessage += ":";
                m_sMessage += pSpecialFaultDetail->varString;
            }
            else if(0 == strcmp("SpecialDetailStruct", pcCmplxFaultName))
            {
                SpecialDetailStruct* pFaultDetail = NULL;
                pFaultDetail = (SpecialDetailStruct*)pFault->
                    getCmplxFaultObject();

                m_sMessage += pFaultDetail->varString;
 }
            else if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
            {
                DivByZeroStruct* pFaultDetail = NULL;
                pFaultDetail = (DivByZeroStruct*)pFault->
                    getCmplxFaultObject();
                char* carrTempBuff =new char[4 * sizeof(char)];
                sprintf(carrTempBuff, "%d", pFaultDetail->varInt);
                m_sMessage += string(carrTempBuff);
                m_sMessage += "\n";

                sprintf(carrTempBuff, "%f", pFaultDetail->varFloat);
                m_sMessage += string(carrTempBuff);
                m_sMessage += "\n";

                m_sMessage += pFaultDetail->varString;
            }
        }
}
----------------------------------------------------------------
Since the user has the knowledge of those fault-types he can extract
the info from them as above.

rgds,
Nithya







Mime
View raw message