You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/03/26 09:44:24 UTC

svn commit: r522444 - /webservices/axis2/trunk/c/samples/client/google/google_client.c

Author: samisa
Date: Mon Mar 26 00:44:21 2007
New Revision: 522444

URL: http://svn.apache.org/viewvc?view=rev&rev=522444
Log:
Added more fault handling logic

Modified:
    webservices/axis2/trunk/c/samples/client/google/google_client.c

Modified: webservices/axis2/trunk/c/samples/client/google/google_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/google/google_client.c?view=diff&rev=522444&r1=522443&r2=522444
==============================================================================
--- webservices/axis2/trunk/c/samples/client/google/google_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/google/google_client.c Mon Mar 26 00:44:21 2007
@@ -108,15 +108,25 @@
     ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
 
     if (axis2_svc_client_get_last_response_has_fault(svc_client, env))
-        printf ("\nResponse has a SOAP fault\n");
-
-    if (axis2_svc_client_get_last_response_soap_envelope(svc_client, env))
     {
-        printf("\n Returned SOAP envelope: %s\n", 
-            AXIOM_NODE_TO_STRING(axiom_soap_envelope_get_base_node(
-                axis2_svc_client_get_last_response_soap_envelope(svc_client, env),
-                env), 
-            env));
+        axiom_soap_envelope_t *soap_envelope = NULL;
+        axiom_soap_body_t *soap_body = NULL;
+        axiom_soap_fault_t *soap_fault = NULL;
+        
+        printf ("\nResponse has a SOAP fault\n");
+        soap_envelope = 
+            axis2_svc_client_get_last_response_soap_envelope(svc_client, env);
+        if (soap_envelope)
+            soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+        if (soap_body)
+            soap_fault = axiom_soap_body_get_fault(soap_body, env);
+        if (soap_fault)
+        {
+            printf("\nReturned SOAP fault: %s\n", 
+                AXIOM_NODE_TO_STRING(axiom_soap_fault_get_base_node(soap_fault,env), 
+                env));
+        }
+        return -1;
     }
 
     if (ret_node)



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