axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r368325 - in /webservices/axis2/trunk/c: include/axis2_error.h modules/xml/soap/soap12_builder_helper.c
Date Thu, 12 Jan 2006 09:17:31 GMT
Author: nandika
Date: Thu Jan 12 01:17:23 2006
New Revision: 368325

URL: http://svn.apache.org/viewcvs?rev=368325&view=rev
Log: (empty)

Modified:
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c

Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=368325&r1=368324&r2=368325&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Thu Jan 12 01:17:23 2006
@@ -393,9 +393,13 @@
         
         AXIS2_ERROR_MULTIPLE_REASON_ELEMENTS_ENCOUNTERED,
         
-        AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED
+        AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED,
         
+        AXIS2_ERROR_SOAP_FAULT_CODE_DOES_NOT_HAVE_A_VALUE,
         
+        AXIS2_ERROR_SOAP_FAULT_SUB_CODE_DOES_NOT_HAVE_A_VALUE,
+        
+        AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED
     };
 
 /** @} */

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c?rev=368325&r1=368324&r2=368325&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c Thu Jan 12 01:17:23
2006
@@ -37,6 +37,8 @@
     
     axis2_bool_t reason_present;
     
+    axis2_bool_t node_present;
+    
     axis2_bool_t role_present;
     
     axis2_bool_t detail_present;
@@ -104,6 +106,7 @@
     builder_helper_impl->sub_code_processing = AXIS2_FALSE;
     builder_helper_impl->detail_element_names = NULL;
     builder_helper_impl->builder_helper.ops = NULL; 
+    builder_helper_impl->node_present = AXIS2_FALSE;
     builder_helper_impl->soap_builder = soap_builder;  
     
     builder_helper_impl->builder_helper.ops = (axis2_soap12_builder_helper_ops_t*) AXIS2_MALLOC(
@@ -190,7 +193,8 @@
                 builder_helper_impl->code_present = AXIS2_TRUE;
                 builder_helper_impl->code_processing = AXIS2_TRUE;
             }
-        }else if(AXIS2_STRCMP(AXIS2_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME, ele_localname) ==
0)
+        }
+        else if(AXIS2_STRCMP(AXIS2_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME, ele_localname) ==
0)
         {
             if(!(builder_helper_impl->code_processing) && !(builder_helper_impl->sub_code_processing))
             {
@@ -219,27 +223,56 @@
                         AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, AXIS2_FAILURE);
                     return NULL;                        
                 }
-            
-            
-            
-            
             }
-        
-        
-        
-        
-        
-        
-        
-        
-        
+            else 
+            {
+                if(builder_helper_impl->code_processing)
+                {
+                    AXIS2_ERROR_SET((*env)->error, 
+                        AXIS2_ERROR_SOAP_FAULT_CODE_DOES_NOT_HAVE_A_VALUE, AXIS2_FAILURE);
+                    return NULL;                            
+                }
+                else
+                {
+                    AXIS2_ERROR_SET((*env)->error, 
+                        AXIS2_ERROR_SOAP_FAULT_CODE_DOES_NOT_HAVE_A_VALUE, AXIS2_FAILURE);
+                    return NULL;                
+                }
+            }
         }
-    
+        else if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_NODE_LOCAL_NAME) == 0)
+        {
+            if(!(builder_helper_impl->reason_processing))
+            {
+                if(builder_helper_impl->reason_present && 
+                    !(builder_helper_impl->role_present) && 
+                    !(builder_helper_impl->detail_present))
+                {
+                    if(builder_helper_impl->node_present)
+                    {
+                        AXIS2_ERROR_SET((*env)->error, 
+                            AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE);
+                        return NULL;
+                    }
+                    else
+                    {
+                        axis2_soap_fault_node_t *soap_fault_node = NULL;
+                        soap_fault_node = axis2_soap_fault_node_create(env);
+                        AXIS2_SOAP_FAULT_NODE_SET_BASE_NODE(soap_fault_node, env, om_ele_node);
+                        AXIS2_SOAP_FAULT_NODE_SET_SOAP_VERSION(soap_fault_node, env, AXIS2_SOAP12);
+                        AXIS2_SOAP_FAULT_SET_NODE(soap_fault, env, soap_fault_node);    
               
+                                        
+                        builder_helper_impl->node_present = AXIS2_TRUE;              
     
+                    }
+                }else
+                {
+                    AXIS2_ERROR_SET((*env)->error, 
+                        AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, AXIS2_FALSE);
+                    return NULL;                
+                }
+                
+            }
+        }        
     }
-    
     return NULL;
 }                                                                                       
                            
-                               
-                             
-                             
-



Mime
View raw message