You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2004/12/03 11:56:49 UTC
cvs commit: ws-axis/c/samples/client/rpcfault MathOps_AxisClientException.cpp
roshan 2004/12/03 02:56:49
Modified: c/samples/client/rpcfault MathOps_AxisClientException.cpp
Log:
fiexed the bug of this sample not showing the out put
Revision Changes Path
1.2 +46 -0 ws-axis/c/samples/client/rpcfault/MathOps_AxisClientException.cpp
Index: MathOps_AxisClientException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/client/rpcfault/MathOps_AxisClientException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOps_AxisClientException.cpp 2 Dec 2004 07:54:01 -0000 1.1
+++ MathOps_AxisClientException.cpp 3 Dec 2004 10:56:49 -0000 1.2
@@ -58,6 +58,52 @@
void MathOps_AxisClientException::processException (ISoapFault* pFault)
{
/*User can do something like deserializing the struct into a string*/
+ /*User can do something like deserializing the struct into a string*/
+ const char* pcFaultcode = (char*) malloc(sizeof(char) * 256);
+ const char* pcFaultstring;
+ 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();
+ //printf("pcDetail:%s\n", pcDetail);
+ if(NULL != pcDetail && 0 != strcmp("", pcDetail))
+ {
+ m_sMessage += pcDetail;
+ }
+ else
+ {
+ pcCmplxFaultName = pFault->getCmplxFaultObjectName().c_str();
+ printf("pcCmplxFaultName:%s\n", pcCmplxFaultName);
+ }
+ 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;
+ }
+ }
}
void MathOps_AxisClientException::processException(exception* e)