axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r408868 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c
Date Tue, 23 May 2006 10:47:49 GMT
Author: nadiramra
Date: Tue May 23 03:47:49 2006
New Revision: 408868

URL: http://svn.apache.org/viewvc?rev=408868&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c?rev=408868&r1=408867&r2=408868&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/FaultMappingDocClient.c Tue
May 23 03:47:49 2006
@@ -18,11 +18,39 @@
 
 #include "CommonClientTestCode.h"
 #include "MathOps.h"
+#include "axis/ISoapFault.h"
 
-void myExceptionHandler(int errorCode, const char *errorString)
+void myExceptionHandler(int exceptionCode, const char *exceptionString, AXISCHANDLE pSoapFault,
void *faultDetail)
 {
+    const char *pcCmplxFaultName;
+    
     exceptionOccurred = C_TRUE;    
-    printf("AxisException : %s\n", errorString);
+    
+    if (pSoapFault)
+    {
+       pcCmplxFaultName = axiscSoapFaultGetCmplxFaultObjectName(pSoapFault);
+       if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
+       {
+         DivByZeroStruct *dbzs = (DivByZeroStruct *)faultDetail;
+         printf("DivByZeroStruct Fault: \"%s\", %d, %f\n", dbzs->varString, dbzs->varInt,
dbzs->varFloat);
+       }
+       else if (0 == strcmp("SpecialDetailStruct", pcCmplxFaultName))
+       {
+        SpecialDetailStruct *sds = (SpecialDetailStruct *)faultDetail;
+        printf("SpecialDetailStruct Fault: \"%s\"\n", sds->varString);
+       }
+       else if (0 == strcmp("OutOfBoundStruct", pcCmplxFaultName))
+       {
+        OutOfBoundStruct *oobs = (OutOfBoundStruct *)faultDetail;
+        printf("OutOfBoundStruct Fault: \"%s\", %d, \"%s\"\n", oobs->varString, oobs->varInt,
oobs->specialDetail->varString);
+       }
+       else
+       {
+          printf("SoapFaultException: %s\n", faultDetail);
+       }
+       
+    }
+    
 }
 
 int main(int argc, char* argv[])
@@ -41,8 +69,6 @@
     char* pcDetail;
     int i;
 
-    axiscAxisRegisterExceptionHandler(myExceptionHandler);
-
     if (argc > 1)
         url = argv[1];
     sprintf(endpoint, "%s", url);
@@ -62,6 +88,8 @@
         }
 
         ws = get_MathOps_stub(endpoint);
+        
+        set_MathOps_ExceptionHandler(ws, myExceptionHandler);        
         
         printf( "Trying to %s %d by %d\n", op, i1, i2 );
         iResult = div(ws, i1, i2);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message