Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 61302 invoked from network); 14 Jun 2004 05:57:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Jun 2004 05:57:53 -0000 Received: (qmail 39331 invoked by uid 500); 14 Jun 2004 05:57:55 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 39256 invoked by uid 500); 14 Jun 2004 05:57:54 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 39235 invoked by uid 99); 14 Jun 2004 05:57:53 -0000 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Sun, 13 Jun 2004 22:57:53 -0700 Received: (qmail 61265 invoked by uid 1683); 14 Jun 2004 05:57:45 -0000 Date: 14 Jun 2004 05:57:45 -0000 Message-ID: <20040614055745.61264.qmail@minotaur.apache.org> From: damitha@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/tests/client/exceptionTest MathOps.h X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N damitha 2004/06/13 22:57:45 Modified: c/tests/client/exceptionTest MathOps.h Log: Revision Changes Path 1.3 +45 -7 ws-axis/c/tests/client/exceptionTest/MathOps.h Index: MathOps.h =================================================================== RCS file: /home/cvs/ws-axis/c/tests/client/exceptionTest/MathOps.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MathOps.h 14 Jun 2004 05:08:17 -0000 1.2 +++ MathOps.h 14 Jun 2004 05:57:45 -0000 1.3 @@ -76,14 +76,52 @@ * throw AxisException(AXISC_NODE_VALUE_MISMATCH_EXCEPTION); * When we catch that exception we knows that a soap fault has come. * - * - * - * - * - * + * else if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/MathOps" )) + * //Exception handling code goes here + * { + * cFaultcode = m_pCall->getElementAsString("faultcode", 0); + * cFaultstring = m_pCall->getElementAsString("faultstring", 0); + * cFaultactor = m_pCall->getElementAsString("faultactor", 0); + * if(0 == strcmp("DivByZeroStruct", cFaultstring)) + * { + * if (AXIS_SUCCESS == m_pCall->checkFault("faultdetail","http://localhost/axis/MathOps")) + * { + * DivByZeroStruct* pFaultDetail = NULL; + * pFaultDetail = (DivByZeroStruct*)m_pCall-> + * getCmplxObject((void*) Axis_DeSerialize_DivByZeroStruct, + * (void*) Axis_Create_DivByZeroStruct, + * (void*) Axis_Delete_DivByZeroStruct,"faultstruct1", 0); + * //Client developers code goes here to handle the struct can be inserted here + * char* temp = pFaultDetail->varString; + * printf("%s\n", temp); + * printf("faultcode:%s\n", cFaultcode); + * printf("faultstring:%s\n", cFaultstring); + * printf("faultactor:%s\n", cFaultactor); + * m_pCall->unInitialize(); + * throw AxisDivByZeroException(pFaultDetail); + * } + * } + * ... + * ... + * Note that we compares cFaultstring which contains soap fault's faultstring + * with the DivByZeroStruct. This is so because in the server side we set the + * faultstring to take the fault's generated type name. If the faultdetail + * is just a simple string + * + * else + * { + * cFaultdetail = m_pCall->getElementAsString("faultdetail", 0); + * throw AxisException(cFaultdetail); + * } + * + * You can also use this class as a test utility to test exceptions. You + * can generate exception in the server side and client side and test + * from here whether the correct exception messages come to the client. + * For example you can remove the shared libraries for MathOps service + * (libmathops.so) from $AXIS_HOME/webservices folder and try to run + * client here. So will get an exception message like "Service library + * is not loaded to the engine". */ - - class MathOps {