ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r373779 - in /webservices/axis2/trunk/c/modules/xml/soap: soap_body.c soap_builder.c
Date Tue, 31 Jan 2006 09:37:21 GMT
Author: nandika
Date: Tue Jan 31 01:37:15 2006
New Revision: 373779

URL: http://svn.apache.org/viewcvs?rev=373779&view=rev
Log:
has_fault function modified 

Modified:
    webservices/axis2/trunk/c/modules/xml/soap/soap_body.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_body.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_body.c?rev=373779&r1=373778&r2=373779&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_body.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_body.c Tue Jan 31 01:37:15 2006
@@ -227,39 +227,27 @@
     axis2_env_t **env) 
 {
     axis2_soap_body_impl_t *body_impl = NULL;
-    axis2_om_node_t *fault_node = NULL;
-    axis2_om_element_t *fault_ele = NULL;
-    axis2_om_element_t *soap_body_ele = NULL;
+    int status = AXIS2_SUCCESS;
     AXIS2_FUNC_PARAM_CHECK(body, env, AXIS2_FAILURE);
     body_impl = AXIS2_INTF_TO_IMPL(body);
-    if(body_impl->has_fault)
-        return body_impl->has_fault;
-    else
+    if(body_impl->soap_fault)
     {
-        soap_body_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(body_impl->om_ele_node,
env);
-        if(soap_body_ele)
+        body_impl->has_fault = AXIS2_TRUE;
+        return AXIS2_TRUE;
+    }
+    else{
+        if(body_impl->soap_builder != NULL)
         {
-            axis2_char_t* localname = NULL;
-            axis2_om_namespace_t *om_ns = NULL;
-            axis2_char_t* namespace_uri = NULL;
-            fault_ele = AXIS2_OM_ELEMENT_GET_FIRST_ELEMENT( soap_body_ele, env, body_impl->om_ele_node,
&fault_node);
-            if (fault_ele)
+            while(!(body_impl->soap_fault) && !(AXIS2_OM_NODE_GET_BUILD_STATUS(body_impl->om_ele_node,
env)))
             {
-                localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(fault_ele, env);
-                om_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(fault_ele, env);
-                if (om_ns)
-                    namespace_uri = AXIS2_OM_NAMESPACE_GET_URI(om_ns, env);
-            
-                if(localname && namespace_uri && fault_ele && AXIS2_STRCMP(AXIS2_SOAP_FAULT_LOCAL_NAME,
localname) == 0 &&
-                       (AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, namespace_uri)
== 0 ||   
-                         AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, namespace_uri)
== 0))
-                 {
-                    body_impl->has_fault = AXIS2_TRUE;
-                    return body_impl->has_fault;
-                 }   
-             }
+                status = AXIS2_SOAP_BUILDER_NEXT(body_impl->soap_builder, env);
+                if(status == AXIS2_FAILURE)
+                    return AXIS2_FALSE;
+            }
         }
     }
+    if(body_impl->soap_fault)
+        return AXIS2_TRUE;
     return AXIS2_FALSE;
 }
 
@@ -452,5 +440,6 @@
         return AXIS2_FAILURE;
     }
     body_impl->soap_fault = soap_fault;
+    body_impl->has_fault = AXIS2_TRUE;
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c?rev=373779&r1=373778&r2=373779&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Tue Jan 31 01:37:15 2006
@@ -420,7 +420,7 @@
     
     om_element = (axis2_om_element_t *)
                 AXIS2_OM_NODE_GET_DATA_ELEMENT(om_element_node, env);
-    
+     
     ele_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_element, env);
     
     
@@ -431,7 +431,6 @@
     }
     if(!parent && is_soap_envelope)
     {   
-        int status = AXIS2_SUCCESS;
         
         if(AXIS2_STRCASECMP(ele_localname, AXIS2_SOAP_ENVELOPE_LOCAL_NAME) != 0)
         {
@@ -447,6 +446,8 @@
         AXIS2_SOAP_ENVELOPE_SET_BUILDER(builder_impl->soap_envelope, env, builder);
         
         status = axis2_soap_builder_process_namespace_data(builder, env, om_element_node,
AXIS2_TRUE);
+        if(status == AXIS2_FAILURE)
+            return AXIS2_FAILURE;
     }
     else if(element_level == 2)
     {
@@ -475,6 +476,8 @@
             AXIS2_SOAP_HEADER_SET_BUILDER(soap_header, env, builder);
             status = axis2_soap_builder_process_namespace_data(builder, env, 
                                 om_element_node, AXIS2_TRUE);
+            if(status == AXIS2_FAILURE)
+                return AXIS2_FAILURE;
             
         }
         else if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP_BODY_LOCAL_NAME) == 0)
@@ -497,6 +500,8 @@
             AXIS2_SOAP_ENVELOPE_SET_BODY(builder_impl->soap_envelope, env, soap_body);
             status = axis2_soap_builder_process_namespace_data(builder, env, 
                         om_element_node, AXIS2_TRUE);
+            if(status == AXIS2_FAILURE)
+                return AXIS2_FAILURE;
         }
         else
         {
@@ -534,8 +539,11 @@
             env_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(envelope_ele, env);
                        
             soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(builder_impl->soap_envelope, env);
+            if(!soap_body )
+                return AXIS2_FAILURE;
             soap_fault = axis2_soap_fault_create(env);
-            
+            if(!soap_fault) 
+                return AXIS2_FAILURE;
             AXIS2_SOAP_FAULT_SET_BASE_NODE(soap_fault, env, om_element_node);
             
             AXIS2_SOAP_FAULT_SET_SOAP_VERSION(soap_fault, env, builder_impl->soap_version);



Mime
View raw message