axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r368310 - in /webservices/axis2/trunk/c: bindings/php/axis2/axis2.c include/axis2_error.h modules/xml/soap/soap12_builder_helper.c modules/xml/soap/soap_builder.c
Date Thu, 12 Jan 2006 08:17:52 GMT
Author: nandika
Date: Thu Jan 12 00:17:34 2006
New Revision: 368310

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

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

Modified: webservices/axis2/trunk/c/bindings/php/axis2/axis2.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2.c?rev=368310&r1=368309&r2=368310&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2.c Thu Jan 12 00:17:34 2006
@@ -121,10 +121,9 @@
 
     allocator = axis2_allocator_init(NULL);    
     log = axis2_log_create(allocator, NULL);
-    stream = axis2_stream_create(allocator, NULL);
     err = axis2_error_create(allocator);
     
-    environment= axis2_env_create_with_error_stream_log(allocator, err,stream, log);
+    environment= axis2_env_create_with_error_log(allocator, err, log);
     
 	axis2_globals->global_value = 0;
 	axis2_globals->global_string = NULL;

Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=368310&r1=368309&r2=368310&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Thu Jan 12 00:17:34 2006
@@ -387,7 +387,15 @@
         AXIS2_ERROR_TRANSPORT_LEVEL_INFORMATION_DOES_NOT_MATCH_WITH_SOAP,
         
         /* Error in writing the response in response writer */
-        AXIS2_ERROR_WRITING_RESPONSE
+        AXIS2_ERROR_WRITING_RESPONSE,
+        
+        AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED,
+        
+        AXIS2_ERROR_MULTIPLE_REASON_ELEMENTS_ENCOUNTERED,
+        
+        AXIS2_ERROR_WRONG_ELEMENT_ORDER_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=368310&r1=368309&r2=368310&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 00:17:34
2006
@@ -16,6 +16,14 @@
  
  #include <axis2_soap12_builder_helper.h>
  #include <axis2_array_list.h>
+ #include <axis2_soap_body.h>
+ #include <axis2_soap_fault.h>
+ #include <axis2_soap_envelope.h>
+ #include <axis2_soap_message.h>
+ #include <axis2_soap_fault_code.h>
+ #include <axis2_soap_fault_node.h>
+ #include <axis2_soap_fault_detail.h>
+ #include <axis2_Soap_fault_reason.h>
 
 /********************* impl struct ********************************************/
  
@@ -23,7 +31,7 @@
 {
     axis2_soap12_builder_helper_t builder_helper;
     
-    axis2_soap_builder_t *soap_model_builder;
+    axis2_soap_builder_t *soap_builder;
     
     axis2_bool_t code_present;
     
@@ -95,7 +103,8 @@
     builder_helper_impl->code_processing = AXIS2_FALSE;
     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->builder_helper.ops = NULL; 
+    builder_helper_impl->soap_builder = soap_builder;  
     
     builder_helper_impl->builder_helper.ops = (axis2_soap12_builder_helper_ops_t*) AXIS2_MALLOC(
                                                 (*env)->allocator, sizeof(axis2_soap12_builder_helper_ops_t));
@@ -142,14 +151,92 @@
 axis2_soap12_builder_helper_handle_event (axis2_soap12_builder_helper_t *builder_helper,
                              axis2_env_t **env,
                              axis2_soap_builder_t *soap_builder,
-                             axis2_om_node_t *om_element_node,
+                             axis2_om_node_t *om_ele_node,
                              int element_level)
 {
     axis2_soap12_builder_helper_impl_t *builder_helper_impl = NULL;
+    axis2_char_t* ele_localname = NULL;
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_element_t *om_ele = NULL;
+    axis2_soap_body_t *soap_body = NULL;
+    axis2_soap_fault_t *soap_fault = NULL;
+    axis2_soap_envelope_t *soap_envelope = NULL;    
+    
+    
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, NULL);
     builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
-
-
+    om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(om_ele_node, env);
+    ele_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_ele, env);
+    
+    soap_envelope = AXIS2_SOAP_BUILDER_GET_SOAP_ENVELOPE(builder_helper_impl->soap_builder,
env);
+    soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
+    soap_fault = AXIS2_SOAP_BODY_GET_FAULT(soap_body, env);   
+    
+    if(element_level == 4)
+    {
+        if(AXIS2_STRCMP(AXIS2_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME, ele_localname) == 0)
+        {
+            if(builder_helper_impl->code_present)
+            {
+                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED,
AXIS2_FAILURE);
+                return NULL;
+            }else
+            {
+                axis2_soap_fault_code_t* soap_fault_code = NULL;
+                soap_fault_code = axis2_soap_fault_code_create(env);
+                AXIS2_SOAP_FAULT_CODE_SET_BASE_NODE(soap_fault, env, om_ele_node);      
     
+                AXIS2_SOAP_FAULT_CODE_SET_SOAP_VERSION(soap_fault_code, env, AXIS2_SOAP12);
+                AXIS2_SOAP_FAULT_SET_CODE(soap_fault, env, soap_fault_code);
+                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)
+        {
+            if(!(builder_helper_impl->code_processing) && !(builder_helper_impl->sub_code_processing))
+            {
+                if(builder_helper_impl->code_present)
+                {
+                    if(builder_helper_impl->reason_present)
+                    {
+                        AXIS2_ERROR_SET((*env)->error, 
+                            AXIS2_ERROR_MULTIPLE_REASON_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE);
+                        return NULL;
+                    }
+                    else
+                    {
+                        axis2_soap_fault_reason_t *fault_reason = NULL;
+                        fault_reason = axis2_soap_fault_reason_create(env);
+                        AXIS2_SOAP_FAULT_REASON_SET_BASE_NODE(fault_reason, env, om_ele_node);
+                        AXIS2_SOAP_FAULT_SET_SOAP_VERSION(fault_reason, env, AXIS2_SOAP12);
+                        AXIS2_SOAP_FAULT_SET_REASON(soap_fault, env, fault_reason);
+                        builder_helper_impl->reason_present = AXIS2_TRUE;
+                        builder_helper_impl->reason_processing = AXIS2_TRUE;
+                    }                
+                }
+                else
+                {
+                    AXIS2_ERROR_SET((*env)->error, 
+                        AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, AXIS2_FAILURE);
+                    return NULL;                        
+                }
+            
+            
+            
+            
+            }
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        }
+    
+    }
+    
     return NULL;
 }                                                                                       
                            
                                

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=368310&r1=368309&r2=368310&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Thu Jan 12 00:17:34 2006
@@ -163,6 +163,7 @@
     builder_impl->processing_mandatory_fault_elements = AXIS2_FALSE;
     builder_impl->receiver_fault_code = NULL;
     builder_impl->sender_fault_code = NULL;
+    builder_impl->soap_version = AXIS2_SOAP12;
     builder_impl->soap_builder.ops = NULL;
     builder_impl->last_node_status = -1;
     builder_impl->envelope_ns = NULL;
@@ -558,5 +559,4 @@
             axis2_soap_builder_next(builder, env);
         }
     }
-
 }                                                                                       
                          



Mime
View raw message