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 na...@apache.org on 2006/01/16 05:21:54 UTC

svn commit: r369337 - in /webservices/axis2/trunk/c: include/ modules/util/ modules/xml/om/ modules/xml/soap/

Author: nandika
Date: Sun Jan 15 20:21:28 2006
New Revision: 369337

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

Modified:
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/include/axis2_om_node.h
    webservices/axis2/trunk/c/include/axis2_soap_builder.h
    webservices/axis2/trunk/c/include/axis2_soap_envelope.h
    webservices/axis2/trunk/c/include/axis2_soap_fault_reason.h
    webservices/axis2/trunk/c/include/axis2_soap_fault_sub_code.h
    webservices/axis2/trunk/c/modules/util/array_list.c
    webservices/axis2/trunk/c/modules/util/error.c
    webservices/axis2/trunk/c/modules/xml/om/om_document.c
    webservices/axis2/trunk/c/modules/xml/om/om_element.c
    webservices/axis2/trunk/c/modules/xml/om/om_node.c
    webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_message.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=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Sun Jan 15 20:21:28 2006
@@ -409,10 +409,28 @@
         
         AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED,
         
-        AXIS2_ERROR_REASON_ELEMENT_SHOULD_HAVE_A_TEXT,
+        AXIS2_ERROR_SOAP_FAULT_REASON_ELEMENT_SHOULD_HAVE_A_TEXT,
         
         AXIS2_ERROR_MULTIPLE_ROLE_ELEMENTS_ENCOUNTERED,
         
+        AXIS2_ERROR_SOAP_FAULT_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT,
+        
+        AXIS2_ERROR_MULTIPLE_DETAIL_ELEMENTS_ENCOUNTERED,
+        
+        AXIS2_ERROR_UNSUPPORTED_ELEMENT_IN_SOAP_FAULT_ELEMENT,
+        
+        AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED,
+        
+        AXIS2_ERROR_MULTIPLE_VALUE_ENCOUNTERED_IN_CODE_ELEMENT,
+        
+        AXIS2_ERROR_SOAP_FAULT_VALUE_SHOULD_BE_PRESENT_BEFORE_SUB_CODE,
+        
+        AXIS2_ERROR_THIS_LOCALNAME_NOT_SUPPORTED_INSIDE_THE_CODE_ELEMENT,
+        
+        AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_REASON_ELEMENT,
+        
+        AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_SUB_CODE_ELEMENT,
+
         AXIS2_ERROR_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT,
     
         /* OM output is NULL */

Modified: webservices/axis2/trunk/c/include/axis2_om_node.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_node.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Sun Jan 15 20:21:28 2006
@@ -41,6 +41,7 @@
     struct axis2_om_node_ops;
     struct axis2_om_output;
     struct axis2_om_document;
+    struct axis2_om_stax_builder;
 /**
  * @defgroup axis2_om_node  OM Node
  * @ingroup axis2_om 
@@ -357,8 +358,7 @@
                                               
     axis2_status_t (AXIS2_CALL *set_builder)(axis2_om_node_t *om_node,
                                              axis2_env_t **env,
-                                             void *builder,
-                                             int builder_type);                                              
+                                             struct axis2_om_stax_builder *builder);                                              
     
                                                                         
 } axis2_om_node_ops_t;
@@ -461,8 +461,8 @@
 #define AXIS2_OM_NODE_BUILD_NEXT(om_node, env) \
         ((om_node)->ops->build_next(om_node, env)) 
         
-#define AXIS2_OM_NODE_SET_BUILDER(om_node, env, builder, builder_type) \
-        ((om_node)->ops->set_builder(om_node, env, builder, builder_type))               
+#define AXIS2_OM_NODE_SET_BUILDER(om_node, env, builder) \
+        ((om_node)->ops->set_builder(om_node, env, builder))               
 
 /** @} */
 

Modified: webservices/axis2/trunk/c/include/axis2_soap_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_builder.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_builder.h Sun Jan 15 20:21:28 2006
@@ -64,6 +64,25 @@
         axis2_om_node_t* (AXIS2_CALL *get_document_element)
                                             (axis2_soap_builder_t *builder,
                                              axis2_env_t **env); 
+                                             
+        axis2_status_t (AXIS2_CALL *set_bool_processing_mandatory_fault_elements)
+                                            (axis2_soap_builder_t *builder,
+                                             axis2_env_t **env,
+                                             axis2_bool_t value);
+        
+        axis2_status_t (AXIS2_CALL *set_processing_detail_elements)
+                                    (axis2_soap_builder_t *builder,
+                                     axis2_env_t **env,
+                                     axis2_bool_t value);
+                                     
+        axis2_bool_t (AXIS2_CALL *is_processing_detail_elements)
+                                    (axis2_soap_builder_t *builder, 
+                                     axis2_env_t **env);
+                                     
+                                     
+        int (AXIS2_CALL *get_soap_version)(axis2_soap_builder_t *builder,
+                                           axis2_env_t **env);
+                                                                                                                                                                                                        
 };
                                                       
 
@@ -106,8 +125,20 @@
         ((builder)->ops->get_document(builder, env))
         
 #define AXIS2_SOAP_BUILDER_NEXT(builder, env) \
-        ((builder)->ops->next(builder, env))       
+        ((builder)->ops->next(builder, env)) 
+        
+#define AXIS2_SOAP_BUILDER_SET_BOOL_PROCESSING_MANDATORY_FAULT_ELEMENTS(builder, env, value) \
+        ((builder)->ops->set_bool_processing_mandatory_fault_elements(builder, env, value))
+ 
+#define AXIS2_SOAP_BUILDER_SET_PROCESSING_DETAIL_ELEMENTS(builder, env, value) \
+        ((builder)->ops->set_processing_detail_elements(builder, env, value))
+        
+#define AXIS2_SOAP_BUILDER_IS_PROCESSING_DETAIL_ELEMENTS(builder, env) \
+        ((builder)->ops->is_processing_detail_elements(builder, env))                         
+
 
+#define AXIS2_SOAP_BUILDER_GET_SOAP_VERSION(builder, env) \
+        ((builder)->ops->get_soap_version(builder, env))
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/include/axis2_soap_envelope.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_envelope.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Sun Jan 15 20:21:28 2006
@@ -38,6 +38,7 @@
     struct axis2_soap_body;
     struct axis2_soap_header;
     struct axis2_soap_header_block;
+    struct axis2_soap_builder;
     
 /**
  * @defgroup axis2_soap_envelope
@@ -134,6 +135,9 @@
                                                 (axis2_soap_envelope_t *envelope,
                                                  axis2_env_t **env);
 
+        axis2_status_t (AXIS2_CALL *set_builder)(axis2_soap_envelope_t *envelope,
+                                                 axis2_env_t **env,
+                                                 struct axis2_soap_builder *builder);
     };
 
   /**
@@ -195,6 +199,8 @@
 #define AXIS2_SOAP_ENVELOPE_GET_NAMESPACE(envelope, env) \
         ((envelope)->ops->get_namespace(envelope, env))
 
+#define AXIS2_SOAP_ENVELOPE_SET_BUILDER(envelope, env, builder) \
+        ((envelope)->ops->set_builder(envelope, env, builder))
 /** @} */
 
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/include/axis2_soap_fault_reason.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_fault_reason.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_fault_reason.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_fault_reason.h Sun Jan 15 20:21:28 2006
@@ -115,7 +115,7 @@
         ((fault_reason)->ops->free_fn(fault_reason, env))
 
 #define AXIS2_SOAP_FAULT_REASON_SET_SOAP_TEXT(fault_reason , env, soap_text) \
-        ((fault_reason)->ops->set_value(fault_reason, env, soap_text))
+        ((fault_reason)->ops->set_soap_text(fault_reason, env, soap_text))
         
 #define AXIS2_SOAP_FAULT_REASON_GET_SOAP_TEXT(fault_reason , env) \
         ((fault_reason)->ops->get_soap_text(fault_reason, env)) 

Modified: webservices/axis2/trunk/c/include/axis2_soap_fault_sub_code.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_fault_sub_code.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_fault_sub_code.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_fault_sub_code.h Sun Jan 15 20:21:28 2006
@@ -128,7 +128,7 @@
         ((fault_sub_code)->ops->free_fn(fault_sub_code, env))
 
 #define AXIS2_SOAP_FAULT_SUB_CODE_SET_SUB_CODE(fault_sub_code , env, subcode) \
-        ((fault_sub_code)->ops->set_subcode(fault_sub_code, env, subcode))
+        ((fault_sub_code)->ops->set_sub_code(fault_sub_code, env, subcode))
 
 #define AXIS2_SOAP_FAULT_SUB_CODE_SET_VALUE(fault_sub_code , env, value) \
         ((fault_sub_code)->ops->set_value(fault_sub_code, env, value))
@@ -149,8 +149,8 @@
 #define AXIS2_SOAP_FAULT_SUB_CODE_GET_SOAP_VRESION(fault_sub_code, env) \
         ((fault_sub_code)->ops->get_soap_version(fault_sub_code, env))
 
-#define AXIS2_SOAP_FAULT_SUB_CODE_SET_SOAP_VRESION(fault_sub_code, env) \
-        ((fault_sub_code)->ops->set_soap_version(fault_sub_code, env))        
+#define AXIS2_SOAP_FAULT_SUB_CODE_SET_SOAP_VRESION(fault_sub_code, env, version) \
+        ((fault_sub_code)->ops->set_soap_version(fault_sub_code, env, version))        
       
 /** @} */
 

Modified: webservices/axis2/trunk/c/modules/util/array_list.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/array_list.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/array_list.c (original)
+++ webservices/axis2/trunk/c/modules/util/array_list.c Sun Jan 15 20:21:28 2006
@@ -32,51 +32,80 @@
 /** Interface to implementation conversion macro */
 #define AXIS2_INTF_TO_IMPL(array_list) ((axis2_array_list_impl_t *)array_list)
 
-axis2_status_t AXIS2_CALL axis2_array_list_ensure_capacity(struct axis2_array_list *array_list, 
-                                                axis2_env_t **env, 
-                                                int min_capacity);
-int AXIS2_CALL axis2_array_list_size(struct axis2_array_list *array_list, 
+axis2_status_t AXIS2_CALL 
+axis2_array_list_ensure_capacity(struct axis2_array_list *array_list, 
+                                 axis2_env_t **env, 
+                                 int min_capacity);
+                                 
+int AXIS2_CALL 
+axis2_array_list_size(struct axis2_array_list *array_list, 
+                      axis2_env_t **env);
+                      
+axis2_bool_t AXIS2_CALL 
+axis2_array_list_is_empty(struct axis2_array_list *array_list, 
                           axis2_env_t **env);
-axis2_bool_t AXIS2_CALL axis2_array_list_is_empty(struct axis2_array_list *array_list, 
-                                       axis2_env_t **env);
-axis2_bool_t AXIS2_CALL axis2_array_list_contains(struct axis2_array_list *array_list, 
+                          
+axis2_bool_t AXIS2_CALL 
+axis2_array_list_contains(struct axis2_array_list *array_list, 
+                          axis2_env_t **env, 
+                          void *e);
+                          
+int AXIS2_CALL 
+axis2_array_list_index_of(struct axis2_array_list *array_list, 
+                          axis2_env_t **env, 
+                          void *e);
+int AXIS2_CALL 
+axis2_array_list_last_index_of(struct axis2_array_list *array_list, 
+                                axis2_env_t **env, 
+                                void *e);
+                                
+void** AXIS2_CALL 
+axis2_array_list_to_array(struct axis2_array_list *array_list, 
+                          axis2_env_t **env);
+                          
+void* AXIS2_CALL 
+axis2_array_list_get(struct axis2_array_list *array_list, 
+                     axis2_env_t **env, 
+                    int index);
+                    
+void* AXIS2_CALL 
+axis2_array_list_set(struct axis2_array_list *array_list, 
+                     axis2_env_t **env, 
+                     int index, 
+                     void* e);
+                     
+axis2_status_t AXIS2_CALL 
+axis2_array_list_add(struct axis2_array_list *array_list, 
+                     axis2_env_t **env, 
+                     void* e);
+                     
+axis2_status_t AXIS2_CALL 
+axis2_array_list_add_at(struct axis2_array_list *array_list, 
+                        axis2_env_t **env, 
+                        int index, 
+                        void* e);    
+                        
+void* AXIS2_CALL 
+axis2_array_list_remove(struct axis2_array_list *array_list, 
+                        axis2_env_t **env, 
+                        int index);
+
+axis2_bool_t AXIS2_CALL 
+axis2_array_list_check_bound_inclusive(struct axis2_array_list *array_list, 
                                        axis2_env_t **env, 
-                                       void *e);
-int AXIS2_CALL axis2_array_list_index_of(struct axis2_array_list *array_list, 
-                              axis2_env_t **env, 
-                              void *e);
-int AXIS2_CALL axis2_array_list_last_index_of(struct axis2_array_list *array_list, 
-                                   axis2_env_t **env, 
-                                   void *e);
-void** AXIS2_CALL axis2_array_list_to_array(struct axis2_array_list *array_list, 
-                                  axis2_env_t **env);
-void* AXIS2_CALL axis2_array_list_get(struct axis2_array_list *array_list, 
-                           axis2_env_t **env, 
-                           int index);
-void* AXIS2_CALL axis2_array_list_set(struct axis2_array_list *array_list, 
-                           axis2_env_t **env, 
-                           int index, 
-                           void* e);
-axis2_status_t AXIS2_CALL axis2_array_list_add(struct axis2_array_list *array_list, 
-                                    axis2_env_t **env, 
-                                    void* e);
-axis2_status_t AXIS2_CALL axis2_array_list_add_at(struct axis2_array_list *array_list, 
+                                       int index);
+                                       
+axis2_bool_t AXIS2_CALL 
+axis2_array_list_check_bound_exclusive(struct axis2_array_list *array_list, 
                                        axis2_env_t **env, 
-                                       int index, 
-                                       void* e);    
-void* AXIS2_CALL axis2_array_list_remove(struct axis2_array_list *array_list, 
-                              axis2_env_t **env, 
-                              int index);
-axis2_bool_t AXIS2_CALL axis2_array_list_check_bound_inclusive(struct axis2_array_list *array_list, 
-                                                    axis2_env_t **env, 
-                                                    int index);
-axis2_bool_t AXIS2_CALL axis2_array_list_check_bound_exclusive(struct axis2_array_list *array_list, 
-                                                    axis2_env_t **env, 
-                                                    int index);
-axis2_status_t AXIS2_CALL axis2_array_list_free(struct axis2_array_list *array_list, 
-                                     axis2_env_t **env);
+                                      int index);
+                                      
+axis2_status_t AXIS2_CALL 
+axis2_array_list_free(struct axis2_array_list *array_list, 
+                      axis2_env_t **env);
 
-struct axis2_array_list* AXIS2_CALL axis2_array_list_create(axis2_env_t **env, int capacity)
+struct axis2_array_list* 
+AXIS2_CALL axis2_array_list_create(axis2_env_t **env, int capacity)
 {
     axis2_array_list_impl_t *array_list_impl = NULL;
     

Modified: webservices/axis2/trunk/c/modules/util/error.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/error.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/error.c (original)
+++ webservices/axis2/trunk/c/modules/util/error.c Sun Jan 15 20:21:28 2006
@@ -336,8 +336,10 @@
         "AXIS2_ERROR_SOAP_FAULT_SUB_CODE_DOES_NOT_HAVE_A_VALUE";
     axis2_error_messages[AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED] =
         "AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED";
+    /*   
     axis2_error_messages[AXIS2_ERROR_REASON_ELEMENT_SHOULD_HAVE_A_TEXT] = 
         "AXIS2_ERROR_REASON_ELEMENT_SHOULD_HAVE_A_TEXT";
+    */
     axis2_error_messages[AXIS2_ERROR_MULTIPLE_ROLE_ELEMENTS_ENCOUNTERED] = 
         "AXIS2_ERROR_MULTIPLE_ROLE_ELEMENTS_ENCOUNTERED";
     axis2_error_messages[AXIS2_ERROR_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT] = 

Modified: webservices/axis2/trunk/c/modules/xml/om/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_document.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_document.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_document.c Sun Jan 15 20:21:28 2006
@@ -330,7 +330,7 @@
     document_impl = AXIS2_INTF_TO_IMPL(document);
     if(!(document_impl->root_element))
     {
-        return AXIS2_FAILURE;
+        axis2_om_document_get_root_element(document, env);        
     }
     return AXIS2_OM_NODE_SERIALIZE(document_impl->root_element, env, om_output);
 }

Modified: webservices/axis2/trunk/c/modules/xml/om/om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_element.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_element.c Sun Jan 15 20:21:28 2006
@@ -617,7 +617,6 @@
                         name, AXIS2_HASH_KEY_STRING,
                         attribute);
     }
-
     return ((qname) ? AXIS2_SUCCESS : AXIS2_FAILURE);
 }
 
@@ -628,7 +627,6 @@
 {
     axis2_char_t *name = NULL;
     axis2_om_attribute_t *attr = NULL;
-    
     AXIS2_FUNC_PARAM_CHECK(om_element, env, NULL);
     
     if (!qname)

Modified: webservices/axis2/trunk/c/modules/xml/om/om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_node.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_node.c Sun Jan 15 20:21:28 2006
@@ -149,8 +149,7 @@
 axis2_status_t AXIS2_CALL
 axis2_om_node_set_builder(axis2_om_node_t *om_node,
                           axis2_env_t **env,
-                          void *builder,
-                          int builder_type);
+                          axis2_om_stax_builder_t *builder);
                            
 struct axis2_om_document* AXIS2_CALL
 axis2_om_node_get_document(axis2_om_node_t *om_node,
@@ -170,7 +169,7 @@
      /** document only availble if build through builder */   
      struct axis2_om_document *om_doc;
      
-     void *builder;
+     axis2_om_stax_builder_t *builder;
      /** parent node */
      axis2_om_node_t *parent;
      /** previous sibling */
@@ -186,7 +185,6 @@
      /** done true means that this node is completely built , false otherwise */
      int done;
      
-     int builder_type;
      /** instances of an om struct, whose type is defined by node type */
      void *data_element;
      
@@ -268,6 +266,8 @@
     
     node->om_node.ops->get_document = axis2_om_node_get_document;
     node->om_node.ops->set_document = axis2_om_node_set_document;
+    node->om_node.ops->set_builder = axis2_om_node_set_builder;
+    
     node->om_node.ops->build_next = axis2_om_node_build_next;
         
     return &(node->om_node);
@@ -591,8 +591,17 @@
 axis2_om_node_get_first_child(axis2_om_node_t *om_node,
                               axis2_env_t **env)
 {   
+    axis2_om_node_impl_t *om_node_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(om_node, env, NULL);
-    return AXIS2_INTF_TO_IMPL(om_node)->first_child;
+    om_node_impl = AXIS2_INTF_TO_IMPL(om_node);
+    /**********************************************************/
+    while(!(om_node_impl->first_child) && !(om_node_impl->done) 
+        && om_node_impl->builder)
+    {
+        AXIS2_OM_STAX_BUILDER_NEXT(om_node_impl->builder, env);
+    }
+    /**********************************************************/
+    return om_node_impl->first_child;
 }
         
 axis2_om_node_t* AXIS2_CALL
@@ -616,8 +625,17 @@
 axis2_om_node_get_next_sibling(axis2_om_node_t *om_node,
                                 axis2_env_t **env)
 {
+    axis2_om_node_impl_t *om_node_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(om_node, env, NULL);
-    return AXIS2_INTF_TO_IMPL(om_node)->next_sibling;
+    om_node_impl = AXIS2_INTF_TO_IMPL(om_node);
+    /*****************************************************/
+    while(!(om_node_impl->next_sibling) && om_node_impl->parent &&
+    om_node_impl->builder && !(AXIS2_OM_NODE_GET_BUILD_STATUS(om_node_impl->parent, env)))
+    {
+        AXIS2_OM_STAX_BUILDER_NEXT(om_node_impl->builder, env);
+    }
+    /*******************************************************/
+    return om_node_impl->next_sibling;
 }
 
 axis2_om_types_t AXIS2_CALL 
@@ -754,21 +772,17 @@
     builder = om_node_impl->builder;
     if(!builder)
         return NULL;
-    if(om_node_impl->builder_type = AXIS2_OM_STAX_BUILDER)        
-        return AXIS2_OM_DOCUMENT_BUILD_NEXT(om_node_impl->om_doc, env);
-    return NULL;        
+    return AXIS2_OM_STAX_BUILDER_NEXT(om_node_impl->builder, env);
 }
 
 axis2_status_t AXIS2_CALL
 axis2_om_node_set_builder(axis2_om_node_t *om_node,
                            axis2_env_t **env,
-                           void* builder,
-                           int builder_type)
+                           axis2_om_stax_builder_t* builder)
 {
     AXIS2_FUNC_PARAM_CHECK(om_node, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, builder, AXIS2_FAILURE);
     AXIS2_INTF_TO_IMPL(om_node)->builder = builder;
-    AXIS2_INTF_TO_IMPL(om_node)->builder_type = builder_type;
     return AXIS2_SUCCESS;
 
 }                           

Modified: webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c Sun Jan 15 20:21:28 2006
@@ -414,6 +414,7 @@
     axis2_om_node_t *element_node;
     axis2_om_stax_builder_impl_t *builder_impl = NULL;
     axis2_char_t *temp_localname = NULL;
+    axis2_om_node_t *parent_node = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(om_stax_builder, env, NULL);
     builder_impl = AXIS2_INTF_TO_IMPL(om_stax_builder);
@@ -437,6 +438,7 @@
         if(builder_impl->document)        
         {
             AXIS2_OM_DOCUMENT_SET_ROOT_ELEMENT(builder_impl->document, env, element_node);
+            builder_impl->root_node = element_node;
         }
         else
         {
@@ -445,8 +447,8 @@
             return  NULL;            
             */
             builder_impl->root_node = element_node;
-        }            
-        
+        }   
+        AXIS2_OM_NODE_SET_BUILDER(element_node, env, om_stax_builder);        
     }
     else if (AXIS2_OM_NODE_GET_BUILD_STATUS(builder_impl->lastnode, env))
     {
@@ -456,6 +458,7 @@
         AXIS2_OM_NODE_SET_NEXT_SIBLING(builder_impl->lastnode, env, element_node);                                 
         AXIS2_OM_NODE_SET_PREVIOUS_SIBLING(element_node , env, builder_impl->lastnode);
         AXIS2_OM_NODE_SET_DOCUMENT(element_node, env, builder_impl->document); 
+         AXIS2_OM_NODE_SET_BUILDER(element_node, env, om_stax_builder);
     }
     else
     {
@@ -465,6 +468,7 @@
         AXIS2_OM_NODE_SET_FIRST_CHILD(builder_impl->lastnode , env, element_node);                     
         AXIS2_OM_NODE_SET_PARENT(element_node , env, builder_impl->lastnode);
         AXIS2_OM_NODE_SET_DOCUMENT(element_node, env, builder_impl->document); 
+         AXIS2_OM_NODE_SET_BUILDER(element_node, env, om_stax_builder);
     }
     
     AXIS2_XML_READER_XML_FREE(builder_impl->parser , env, temp_localname);
@@ -614,7 +618,6 @@
                                    axis2_env_t **env)
 {
     axis2_om_node_t *parent = NULL;
-    axis2_om_node_t *root_node = NULL;
     axis2_om_stax_builder_impl_t *builder = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(om_stax_builder, env, AXIS2_FAILURE );
@@ -637,8 +640,7 @@
             AXIS2_OM_NODE_SET_BUILD_STATUS((builder->lastnode), env, AXIS2_TRUE);
         }
     }
-    root_node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(builder->document, env);
-    if(AXIS2_OM_NODE_GET_BUILD_STATUS(root_node, env))
+    if(AXIS2_OM_NODE_GET_BUILD_STATUS(builder->root_node , env))
         builder->done = AXIS2_TRUE;
    
     return AXIS2_SUCCESS;

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=369337&r1=369336&r2=369337&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 Sun Jan 15 20:21:28 2006
@@ -24,6 +24,9 @@
  #include <axis2_soap_fault_node.h>
  #include <axis2_soap_fault_detail.h>
  #include <axis2_soap_fault_reason.h>
+ #include <axis2_soap_fault_role.h>
+ #include <axis2_soap_fault_value.h>
+ #include <axis2_soap_fault_text.h>
 
 /********************* impl struct ********************************************/
  
@@ -49,6 +52,8 @@
     
     axis2_bool_t sub_code_present;
     
+    axis2_bool_t sub_sub_code_present;
+    
     axis2_bool_t code_processing;
     
     axis2_bool_t sub_code_processing;
@@ -107,7 +112,8 @@
     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->soap_builder = soap_builder;
+    builder_helper_impl->sub_sub_code_present = AXIS2_FALSE;  
     
     builder_helper_impl->builder_helper.ops = (axis2_soap12_builder_helper_ops_t*) AXIS2_MALLOC(
                                                 (*env)->allocator, sizeof(axis2_soap12_builder_helper_ops_t));
@@ -274,14 +280,14 @@
             else
             {
                     AXIS2_ERROR_SET((*env)->error, 
-                        AXIS2_ERROR_REASON_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FALSE);
+                        AXIS2_ERROR_SOAP_FAULT_REASON_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FALSE);
                     return NULL;                        
             }
             
         }
         else if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME) == 0)
         {
-           /* if(!(builder_helper_impl->reason_processing))
+            if(!(builder_helper_impl->reason_processing))
             {
                 if(builder_helper_impl->reason_present && !(builder_helper_impl->detail_present))
                 {
@@ -311,22 +317,271 @@
             }
             else
             {
-                AXIS2_ERROR_SET((*env)->error. AXIS2_ERROR_S
-            
-            
-            
-            
-            
+                AXIS2_ERROR_SET((*env)->error,  AXIS2_ERROR_SOAP_FAULT_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FAILURE);
+            }
+        }
+        else if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME) == 0)
+        {
+            if(!(builder_helper_impl->reason_processing))
+            {
+                if(builder_helper_impl->reason_present)
+                {
+                    if(builder_helper_impl->detail_present)
+                    {
+                        AXIS2_ERROR_SET((*env)->error, 
+                            AXIS2_ERROR_MULTIPLE_DETAIL_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE);
+                        return NULL;                                            
+                    }
+                    else
+                    {
+                        axis2_soap_fault_detail_t *soap_fault_detail = NULL;
+                        soap_fault_detail = axis2_soap_fault_detail_create(env);
+                        AXIS2_SOAP_FAULT_DETAIL_SET_BASE_NODE(soap_fault_detail, env, om_ele_node);
+                        AXIS2_SOAP_FAULT_SET_SOAP_VERSION(soap_fault_detail, env, AXIS2_SOAP12);
+                        AXIS2_SOAP_FAULT_SET_DETAIL(soap_fault, env, soap_fault_detail);
+                        builder_helper_impl->detail_present = AXIS2_TRUE;
+                    }                        
+                }
+                else
+                {
+                    AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, AXIS2_FAILURE);
+                    return NULL;
+                }
+            }
+            else
+            {
+                AXIS2_ERROR_SET((*env)->error, 
+                    AXIS2_ERROR_SOAP_FAULT_REASON_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FAILURE);
+                return NULL;                    
+            }
             
+        }
+        else
+        {
+            AXIS2_ERROR_SET((*env)->error, 
+                AXIS2_ERROR_UNSUPPORTED_ELEMENT_IN_SOAP_FAULT_ELEMENT, AXIS2_FAILURE);
+                return NULL;
+        }
+    }
+    else if(element_level == 5)
+    {
+        axis2_om_node_t *parent_node = NULL;
+        axis2_om_element_t *parent_ele = NULL;
+        axis2_char_t *parent_localname = NULL;
+        parent_node = AXIS2_OM_NODE_GET_PARENT(om_ele_node, env);
+        parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent_node, env);
+        parent_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(parent_ele, env);
+        if(AXIS2_STRCMP(parent_localname, 
+            AXIS2_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME) == 0)
+        {
+            if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME) == 0)
+            {
+                if(!(builder_helper_impl->value_present))
+                {
+                    axis2_soap_fault_value_t *soap_fault_value = NULL;
+                    axis2_soap_fault_code_t *parent_fcode = NULL;
+                    soap_fault_value = axis2_soap_fault_value_create(env);
+                    AXIS2_SOAP_FAULT_VALUE_SET_BASE_NODE(soap_fault_value, env, om_ele_node);
+                    AXIS2_SOAP_FAULT_VALUE_SET_SOAP_VERSION(soap_fault_value, env, AXIS2_SOAP12);                    
+                    
+                    
+                    parent_fcode = AXIS2_SOAP_FAULT_GET_CODE(soap_fault, env);
+                    AXIS2_SOAP_FAULT_CODE_SET_VALUE(parent_fcode, env, soap_fault_value);
+                    builder_helper_impl->value_present = AXIS2_TRUE;
+                }
+                else
+                {
+                    AXIS2_ERROR_SET((*env)->error, 
+                        AXIS2_ERROR_MULTIPLE_VALUE_ENCOUNTERED_IN_CODE_ELEMENT, AXIS2_FAILURE);
+                    return NULL;                        
+                }            
+            }
+            else if(AXIS2_STRCMP(ele_localname, 
+                AXIS2_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0)
+            {
+                if(!(builder_helper_impl->sub_code_present))
+                {
+                    if(builder_helper_impl->value_present)
+                    {
+                        axis2_soap_fault_sub_code_t *fault_subcode = NULL;
+                        axis2_soap_fault_code_t *fault_code = NULL;
+                        fault_subcode = axis2_soap_fault_sub_code_create(env);
+                        AXIS2_SOAP_FAULT_SUB_CODE_SET_BASE_NODE(fault_subcode, env, om_ele_node);
+                        AXIS2_SOAP_FAULT_SUB_CODE_SET_SOAP_VRESION(fault_subcode, env, AXIS2_SOAP12);
+                        fault_code = AXIS2_SOAP_FAULT_GET_CODE(soap_fault, env);
+                        AXIS2_SOAP_FAULT_CODE_SET_SUB_CODE(fault_code, env, fault_subcode);
+                        builder_helper_impl->sub_code_present = AXIS2_TRUE;
+                        builder_helper_impl->sub_code_processing = AXIS2_TRUE;
+                    }
+                    else
+                    {
+                        AXIS2_ERROR_SET((*env)->error,
+                            AXIS2_ERROR_SOAP_FAULT_VALUE_SHOULD_BE_PRESENT_BEFORE_SUB_CODE, AXIS2_FAILURE);
+                        return NULL;                                                            
+                    }
+                }
+                else 
+                {
+                    AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, AXIS2_FAILURE);
+                    return NULL;                    
+                }            
+            }
+            else
+            {
+                AXIS2_ERROR_SET((*env)->error, 
+                    AXIS2_ERROR_THIS_LOCALNAME_NOT_SUPPORTED_INSIDE_THE_CODE_ELEMENT, AXIS2_FAILURE);
+                return NULL;                    
+            }
+        }
+        else if(AXIS2_STRCMP(parent_localname, AXIS2_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME) == 0)
+        {
+            if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_TEXT_LOCAL_NAME) == 0)
+            {
+                axis2_soap_fault_text_t *soap_fault_text = NULL;
+                axis2_soap_fault_reason_t *fault_reason = NULL;
+                soap_fault_text = axis2_soap_fault_text_create(env);
+                AXIS2_SOAP_FAULT_TEXT_SET_BASE_NODE(soap_fault_text, env, om_ele_node);
+                AXIS2_SOAP_FAULT_TEXT_SET_SOAP_VERSION(soap_fault_text, env, AXIS2_SOAP12);
+                fault_reason = AXIS2_SOAP_FAULT_GET_REASON(soap_fault, env);
+                AXIS2_SOAP_FAULT_REASON_SET_SOAP_TEXT(fault_reason, env, soap_fault_text);
+                /*****************
+                AXIS2_OM_NODE_SET_BUILD_STATUS(om_ele_node, env, AXIS2_FALSE);
+                ******************/
+                builder_helper_impl->reason_processing = AXIS2_FALSE;
+                AXIS2_SOAP_BUILDER_SET_BOOL_PROCESSING_MANDATORY_FAULT_ELEMENTS(builder_helper_impl->soap_builder, env, AXIS2_FALSE );
+                
+            }
+            else
+            {
+                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_REASON_ELEMENT, AXIS2_FAILURE);   
+                return NULL;
+            }
             
+        }else if(AXIS2_STRCMP(parent_localname, AXIS2_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME) == 0)
+        {
+            AXIS2_SOAP_BUILDER_SET_PROCESSING_DETAIL_ELEMENTS(builder_helper_impl->soap_builder, env, AXIS2_TRUE);
+            if(!(builder_helper_impl->detail_element_names))
+            {
+                builder_helper_impl->detail_element_names = axis2_array_list_create(env, 20);
             }
-                            
             
+            AXIS2_ARRAY_LIST_ADD(builder_helper_impl->detail_element_names, env, ele_localname);
             
+        }
+        else
+        {
+            /*  throw new OMBuilderException(
+                        parent.getLocalName() +
+                        " should not have child element");
+            */                        
+
+            return NULL;
+        }
+                
+    }else if(element_level > 5)
+    {
+        axis2_om_node_t *parent_node = NULL;
+        axis2_om_element_t *parent_ele = NULL;
+        axis2_char_t *parent_localname = NULL;
+        parent_node = AXIS2_OM_NODE_GET_PARENT(om_ele_node, env);
+        parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent_node, env);
+        parent_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(parent_ele, env);   
+        
+        if(AXIS2_STRCMP(parent_localname, AXIS2_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0)
+        {
+            if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME) == 0)
+            {
+                if(builder_helper_impl->subcode_value_present)
+                {
+                    AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, AXIS2_FAILURE);
+                    return NULL;
+                }
+                else
+                {
+                    axis2_soap_fault_sub_code_t *sub_code = NULL;
+                    axis2_soap_fault_code_t *code = NULL;
+                    axis2_soap_fault_value_t *value = NULL;
+                    code = AXIS2_SOAP_FAULT_GET_CODE(soap_fault, env);
+                    sub_code = AXIS2_SOAP_FAULT_CODE_GET_SUB_CODE(code, env);
+                    value = axis2_soap_fault_value_create(env);
+                    AXIS2_SOAP_FAULT_VALUE_SET_BASE_NODE(value, env, om_ele_node);
+                    AXIS2_SOAP_FAULT_VALUE_SET_SOAP_VERSION(value, env, AXIS2_SOAP12);
+                    AXIS2_SOAP_FAULT_SUB_CODE_SET_VALUE(sub_code, env, value);
+                    
+                    builder_helper_impl->subcode_value_present = AXIS2_TRUE;
+                    builder_helper_impl->sub_sub_code_present = AXIS2_FALSE;
+                    builder_helper_impl->sub_code_processing = AXIS2_FALSE;
+                                    
+                }
+            }
+            else if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0)
+            {
+                if(builder_helper_impl->subcode_value_present)
+                {
+                    if(!(builder_helper_impl->sub_sub_code_present))
+                    {
+                        axis2_soap_fault_code_t *fault_code = NULL;
+                        axis2_soap_fault_sub_code_t *parent_subcode = NULL;
+                        axis2_soap_fault_sub_code_t *subcode = NULL;
+                        subcode = axis2_soap_fault_sub_code_create(env);
+                        AXIS2_SOAP_FAULT_SUB_CODE_SET_BASE_NODE(subcode, env, om_ele_node);
+                        AXIS2_SOAP_FAULT_SUB_CODE_SET_SOAP_VRESION(subcode, env, AXIS2_SOAP12);
+                        fault_code = AXIS2_SOAP_FAULT_GET_CODE(soap_fault, env);
+                        parent_subcode = AXIS2_SOAP_FAULT_CODE_GET_SUB_CODE(fault_code, env);
+                        AXIS2_SOAP_FAULT_SUB_CODE_SET_SUB_CODE(parent_subcode, env, subcode);
+                        
+                        builder_helper_impl->subcode_value_present = AXIS2_FALSE;
+                        builder_helper_impl->sub_sub_code_present = AXIS2_TRUE;
+                        builder_helper_impl->sub_code_processing = AXIS2_TRUE;                        
+                    }
+                    else
+                    {
+                        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, AXIS2_FAILURE);
+                        return NULL;                                                        
+                    }
+                }
+                else
+                {
+                    AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_SOAP_FAULT_VALUE_SHOULD_BE_PRESENT_BEFORE_SUB_CODE, AXIS2_FAILURE);
+                    return NULL;
+                
+                }
+            }
+            else
+            {
+                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_SUB_CODE_ELEMENT, AXIS2_FAILURE);
+                return NULL;
+            } 
+        }
+        else if(AXIS2_SOAP_BUILDER_IS_PROCESSING_DETAIL_ELEMENTS(builder_helper_impl->soap_builder, env))
+        {
+            int detail_element_level = 0;
+            axis2_bool_t local_name_exists = AXIS2_FALSE;
+            int i = 0;
+            for(i =0; i < AXIS2_ARRAY_LIST_SIZE(builder_helper_impl->detail_element_names, env) ; i++)
+            {
+                if(AXIS2_STRCMP(parent_localname, AXIS2_ARRAY_LIST_GET(builder_helper_impl->detail_element_names, env, i)) == 0)
+                {
+                    local_name_exists = AXIS2_TRUE;
+                    detail_element_level = i+ 1;               
+                }
+            }
+            if(local_name_exists)
+            {
+                AXIS2_ARRAY_LIST_ADD(builder_helper_impl->detail_element_names, env, ele_localname);            
             
-            }        
-            */
-        }        
-    }
+            }
+            else
+            {
+                /*
+                    throw new OMBuilderException(
+                        parent.getLocalName() +
+                        " should not have child at element level " +
+                        elementLevel);
+                */
+                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=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Sun Jan 15 20:21:28 2006
@@ -99,7 +99,8 @@
                                 (axis2_soap_builder_t *builder,
                                  axis2_env_t **env); 
                                  
-axis2_om_node_t *axis2_soap_builder_create_om_element
+axis2_status_t 
+axis2_soap_builder_create_om_element
                                 (axis2_soap_builder_t *builder,
                                  axis2_env_t **env,
                                  axis2_om_node_t *current_node);
@@ -128,10 +129,31 @@
                                 axis2_om_node_t *element_node,
                                 axis2_bool_t is_soap_envelope);                      
 
-
 static axis2_status_t 
-parse_headers(axis2_soap_builder_t *builder,
-              axis2_env_t **env); 
+axis2_soap_builder_parse_headers(axis2_soap_builder_t *builder,
+                                 axis2_env_t **env); 
+              
+
+axis2_status_t AXIS2_CALL 
+axis2_soap_builder_set_bool_processing_mandatory_fault_elements
+                                    (axis2_soap_builder_t *builder,
+                                     axis2_env_t **env,
+                                     axis2_bool_t value);
+                                     
+axis2_status_t AXIS2_CALL 
+axis2_soap_builder_set_processing_detail_elements
+                                    (axis2_soap_builder_t *builder,
+                                     axis2_env_t **env,
+                                     axis2_bool_t value); 
+                                     
+axis2_bool_t AXIS2_CALL 
+axis2_soap_builder_is_processing_detail_elements
+                            (axis2_soap_builder_t *builder, 
+                             axis2_env_t **env); 
+                             
+int AXIS2_CALL
+axis2_soap_builder_get_soap_version (axis2_soap_builder_t *builder, 
+                             axis2_env_t **env);                                                                                                                   
 
 /***************** function implementations ***********************************/
 
@@ -153,6 +175,7 @@
         return NULL;
     }
     
+    
     builder_impl->body_present = AXIS2_FALSE;
     builder_impl->builder_helper = NULL;
     builder_impl->element_level= 0;
@@ -167,7 +190,8 @@
     builder_impl->soap_builder.ops = NULL;
     builder_impl->last_node_status = -1;
     builder_impl->envelope_ns = NULL;
-    
+    builder_impl->soap_envelope = NULL;
+    builder_impl->soap_message = NULL;
     builder_impl->soap_builder.ops = (axis2_soap_builder_ops_t*)
             AXIS2_MALLOC((*env)->allocator, sizeof(axis2_soap_builder_ops_t));
     if(!(builder_impl->soap_builder.ops))
@@ -185,7 +209,15 @@
     builder_impl->soap_builder.ops->get_soap_envelope =
             axis2_soap_builder_get_soap_envelope;
     builder_impl->soap_builder.ops->get_document =
-            axis2_soap_builder_get_document;                                   
+            axis2_soap_builder_get_document;
+    builder_impl->soap_builder.ops->set_bool_processing_mandatory_fault_elements =
+            axis2_soap_builder_set_bool_processing_mandatory_fault_elements;                
+    builder_impl->soap_builder.ops->set_processing_detail_elements =
+            axis2_soap_builder_set_processing_detail_elements;
+    builder_impl->soap_builder.ops->is_processing_detail_elements = 
+            axis2_soap_builder_is_processing_detail_elements;            
+    builder_impl->soap_builder.ops->get_soap_version =
+            axis2_soap_builder_get_soap_version;
     status = identify_soap_version(&(builder_impl->soap_builder), env, soap_version);
     if(status == AXIS2_FAILURE)
     {
@@ -204,14 +236,15 @@
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     if(builder_impl->builder_helper)
     {
-        if(builder_impl->soap_version == AXIS2_SOAP11)
+     /*   if(builder_impl->soap_version == AXIS2_SOAP11 && builder_impl->builder_helper)
         {
             AXIS2_SOAP11_BUILDER_HELPER_FREE((axis2_soap11_builder_helper_t *)(builder_impl->builder_helper), env);
         }
-        else if(builder_impl->soap_version == AXIS2_SOAP12)
+        else if(builder_impl->soap_version == AXIS2_SOAP12 && builder_impl->builder_helper)
         {
             AXIS2_SOAP12_BUILDER_HELPER_FREE((axis2_soap12_builder_helper_t *)(builder_impl->builder_helper), env);
         }
+      */                
     }
     if(builder->ops)
     {
@@ -228,13 +261,21 @@
                                  axis2_env_t **env)
 {
     axis2_soap_builder_impl_t *builder_impl = NULL;
+    void *value = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder, env, NULL);
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    
+    if(!(builder_impl->om_builder))
+        return NULL;
+    
+ //   value = axis2_soap_builder_next(builder, env);        
+
     while(!(builder_impl->soap_envelope) || 
-        !AXIS2_OM_STAX_BUILDER_IS_COMPLETE(builder_impl->om_builder, env))
+        AXIS2_OM_STAX_BUILDER_IS_COMPLETE(builder_impl->om_builder, env))
     {
-        axis2_soap_builder_next(builder, env);
+       value = axis2_soap_builder_next(builder, env); 
     }        
+    
     return builder_impl->soap_envelope;
 }
                                 
@@ -256,6 +297,7 @@
     axis2_soap_builder_impl_t *builder_impl = NULL;
     axis2_om_node_t *lastnode = NULL;
     axis2_om_node_t *current_node =  NULL;
+    int status = AXIS2_SUCCESS;
     AXIS2_FUNC_PARAM_CHECK(builder, env, NULL);
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     lastnode = AXIS2_OM_STAX_BUILDER_GET_LAST_NODE(builder_impl->om_builder, env);
@@ -303,33 +345,34 @@
     return AXIS2_SUCCESS;
 }                                                          
                                      
-axis2_om_node_t *
+axis2_status_t
 axis2_soap_builder_create_om_element
                                 (axis2_soap_builder_t *builder,
                                  axis2_env_t **env,
                                  axis2_om_node_t *current_node)
 {
     axis2_soap_builder_impl_t *builder_impl = NULL;
-    AXIS2_FUNC_PARAM_CHECK( builder, env, NULL);
-    AXIS2_PARAM_CHECK((*env)->error, current_node, NULL);
+    void *ret_val = NULL;
+    AXIS2_FUNC_PARAM_CHECK( builder, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, current_node, AXIS2_FAILURE);
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     builder_impl->element_level++;
     if(builder_impl->last_node_status == AXIS2_BUILDER_LAST_NODE_NULL)
     {
-        axis2_soap_builder_construct_node(builder, env, NULL, current_node, AXIS2_TRUE);
+       ret_val =  axis2_soap_builder_construct_node(builder, env, NULL, current_node, AXIS2_TRUE);
          
     }else if(builder_impl->last_node_status == AXIS2_BUILDER_LAST_NODE_DONE_TRUE)
     {
-        axis2_soap_builder_construct_node(builder, env, 
+      ret_val =  axis2_soap_builder_construct_node(builder, env, 
             AXIS2_OM_NODE_GET_PARENT(current_node, env), current_node, AXIS2_FALSE);
     
     }
     else
     {
-       axis2_soap_builder_construct_node(builder, env, 
+       ret_val = axis2_soap_builder_construct_node(builder, env, 
             AXIS2_OM_NODE_GET_PARENT(current_node, env), current_node, AXIS2_FALSE);
     }
-    return current_node;  
+    return ret_val ? AXIS2_SUCCESS : AXIS2_FAILURE;
 }   
 
 static axis2_om_node_t* 
@@ -346,26 +389,32 @@
     axis2_om_element_t *om_element = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder, env, NULL);
     AXIS2_PARAM_CHECK((*env)->error, om_element_node, NULL);
+    
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    
     om_element = (axis2_om_element_t *)
                 AXIS2_OM_NODE_GET_DATA_ELEMENT(om_element_node, env);
     
+    element_name = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_element, env);
     if(parent)
     {
         parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent, env);
         parent_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(parent_ele, env);
     }
-    if(!parent)
+    if(!parent && is_soap_envelope)
     {
-        if(AXIS2_STRCASECMP(element_name, AXIS2_SOAP_ENVELOPE_LOCAL_NAME) == 0)
+        int status = AXIS2_SUCCESS;
+        if(AXIS2_STRCASECMP(element_name, AXIS2_SOAP_ENVELOPE_LOCAL_NAME) != 0)
         {
             AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_SOAP_MESSAGE_FIRST_ELEMENT_MUST_CONTAIN_LOCAL_NAME, AXIS2_FAILURE);
             return NULL;   
         }
         builder_impl->soap_envelope = axis2_soap_envelope_create_null(env);
-        AXIS2_SOAP_ENVELOPE_SET_BASE_NODE(builder_impl->soap_envelope, env, om_element_node);
+       
+        status = AXIS2_SOAP_ENVELOPE_SET_BASE_NODE(builder_impl->soap_envelope, env, om_element_node);
         AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(builder_impl->soap_envelope, env, builder_impl->soap_version);
         axis2_soap_builder_process_namespace_data(builder, env, om_element_node, AXIS2_TRUE);
+        
     }
     else if(builder_impl->element_level == 2)
     {
@@ -514,6 +563,8 @@
     axis2_char_t *ns_uri = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FAILURE);
+    
+    
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     builder_impl->soap_envelope = 
         axis2_soap_builder_get_soap_envelope(builder, env);
@@ -542,7 +593,7 @@
 } 
 
 static axis2_status_t 
-parse_headers(axis2_soap_builder_t *builder,
+axis2_soap_builder_parse_headers(axis2_soap_builder_t *builder,
               axis2_env_t **env)
 {
     axis2_soap_builder_impl_t *builder_impl = NULL;
@@ -557,6 +608,54 @@
         while(!AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, env))
         {
             axis2_soap_builder_next(builder, env);
+            
         }
     }
-}                                                                                                                  
+} 
+
+axis2_status_t AXIS2_CALL 
+axis2_soap_builder_set_bool_processing_mandatory_fault_elements
+                                    (axis2_soap_builder_t *builder,
+                                     axis2_env_t **env,
+                                     axis2_bool_t value)
+{
+    axis2_soap_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FALSE);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    builder_impl->processing_mandatory_fault_elements = value;
+    return AXIS2_SUCCESS;
+}                                                                                                                                                      
+
+axis2_status_t AXIS2_CALL 
+axis2_soap_builder_set_processing_detail_elements
+                                    (axis2_soap_builder_t *builder,
+                                     axis2_env_t **env,
+                                     axis2_bool_t value)
+{
+    axis2_soap_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FALSE);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    builder_impl->processing_detail_elements = value;
+    return AXIS2_SUCCESS;
+}    
+
+axis2_bool_t AXIS2_CALL 
+axis2_soap_builder_is_processing_detail_elements
+                            (axis2_soap_builder_t *builder, 
+                             axis2_env_t **env)
+{
+    axis2_soap_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FALSE);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    return builder_impl->processing_detail_elements ;
+}     
+
+int AXIS2_CALL
+axis2_soap_builder_get_soap_version (axis2_soap_builder_t *builder, 
+                             axis2_env_t **env)
+{
+    axis2_soap_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FALSE);
+     builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    return builder_impl->soap_version ;
+}                                                                                     
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Sun Jan 15 20:21:28 2006
@@ -20,6 +20,7 @@
  #include <axis2_soap_header_block.h>
  #include <axis2_hash.h>
  #include <axis2_soap.h>
+ #include <axis2_soap_builder.h>
  
  /******************* impl struct *********************************************/
  
@@ -35,6 +36,8 @@
      
     axis2_soap_body_t *body;
     
+    axis2_soap_builder_t *soap_builder;
+    
  }axis2_soap_envelope_impl_t;
  
  /****************** Macro ****************************************************/
@@ -98,6 +101,11 @@
 axis2_om_namespace_t* AXIS2_CALL 
 axis2_soap_envelope_get_namespace(axis2_soap_envelope_t *envelope,
                                   axis2_env_t **env);
+                                  
+axis2_status_t AXIS2_CALL
+axis2_soap_envelope_set_builder(axis2_soap_envelope_t *envelope,
+                                axis2_env_t **env,
+                                axis2_soap_builder_t *soap_builder);                                  
 
                                    
 /*************** function implementations *************************************/
@@ -120,6 +128,7 @@
     envelope_impl->soap_version = AXIS2_SOAP12;    
     envelope_impl->header = NULL;
     envelope_impl->body = NULL;
+    envelope_impl->soap_builder = NULL;
     
     envelope_impl->soap_envelope.ops  = AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_soap_envelope_ops_t) );
     if (!envelope_impl->soap_envelope.ops)
@@ -128,18 +137,35 @@
         axis2_soap_envelope_free(&(envelope_impl->soap_envelope), env);
         return NULL;        
     }
+   
+    envelope_impl->soap_envelope.ops->free = axis2_soap_envelope_free;
     
-    envelope_impl->soap_envelope.ops->get_header = axis2_soap_envelope_get_header;
+    envelope_impl->soap_envelope.ops->get_base_node = 
+            axis2_soap_envelope_get_base_node;
+    envelope_impl->soap_envelope.ops->set_base_node = 
+            axis2_soap_envelope_set_base_node;
+    envelope_impl->soap_envelope.ops->get_soap_version = 
+            axis2_soap_envelope_get_soap_version;
+    envelope_impl->soap_envelope.ops->set_soap_version = 
+            axis2_soap_envelope_set_soap_version;
+    envelope_impl->soap_envelope.ops->get_body = 
+            axis2_soap_envelope_get_body;
+    envelope_impl->soap_envelope.ops->set_body = 
+            axis2_soap_envelope_set_body;
+    
+    envelope_impl->soap_envelope.ops->get_header = 
+            axis2_soap_envelope_get_header;
    /* envelope_impl->soap_envelope.ops->add_header = axis2_soap_envelope_add_header; */
-    envelope_impl->soap_envelope.ops->get_body = axis2_soap_envelope_get_body;
-    envelope_impl->soap_envelope.ops->serialize = axis2_soap_envelope_serialize;    
-    envelope_impl->soap_envelope.ops->free = axis2_soap_envelope_free;
-    envelope_impl->soap_envelope.ops->get_base_node = axis2_soap_envelope_get_base_node;
-    envelope_impl->soap_envelope.ops->get_soap_version = axis2_soap_envelope_get_soap_version;
-    envelope_impl->soap_envelope.ops->set_soap_version = axis2_soap_envelope_set_soap_version;
-    envelope_impl->soap_envelope.ops->get_namespace = axis2_soap_envelope_get_namespace;
-    envelope_impl->soap_envelope.ops->set_body = axis2_soap_envelope_set_body;
-    envelope_impl->soap_envelope.ops->set_header = axis2_soap_envelope_set_header;
+    envelope_impl->soap_envelope.ops->set_header = 
+            axis2_soap_envelope_set_header;
+    envelope_impl->soap_envelope.ops->get_namespace = 
+            axis2_soap_envelope_get_namespace;      
+              
+    envelope_impl->soap_envelope.ops->serialize = 
+            axis2_soap_envelope_serialize;    
+    
+    
+    
     
     return &(envelope_impl->soap_envelope);        
 }
@@ -182,16 +208,27 @@
         return NULL;        
     }
     
-    envelope_impl->soap_envelope.ops->get_header = axis2_soap_envelope_get_header;
+    envelope_impl->soap_envelope.ops->get_header = 
+        axis2_soap_envelope_get_header;
   /*  envelope_impl->soap_envelope.ops->add_header = axis2_soap_envelope_add_header; */
-    envelope_impl->soap_envelope.ops->get_body = axis2_soap_envelope_get_body;
-    envelope_impl->soap_envelope.ops->serialize = axis2_soap_envelope_serialize;    
-    envelope_impl->soap_envelope.ops->free = axis2_soap_envelope_free;
-    envelope_impl->soap_envelope.ops->get_base_node = axis2_soap_envelope_get_base_node;
-    envelope_impl->soap_envelope.ops->get_soap_version = axis2_soap_envelope_get_soap_version;
-    envelope_impl->soap_envelope.ops->set_soap_version = axis2_soap_envelope_set_soap_version;
-    envelope_impl->soap_envelope.ops->get_namespace = axis2_soap_envelope_get_namespace;
-    
+    envelope_impl->soap_envelope.ops->get_body = 
+        axis2_soap_envelope_get_body;
+    envelope_impl->soap_envelope.ops->serialize = 
+        axis2_soap_envelope_serialize;    
+    envelope_impl->soap_envelope.ops->free = 
+        axis2_soap_envelope_free;
+    envelope_impl->soap_envelope.ops->get_base_node = 
+        axis2_soap_envelope_get_base_node;
+    envelope_impl->soap_envelope.ops->get_soap_version = 
+        axis2_soap_envelope_get_soap_version;
+    envelope_impl->soap_envelope.ops->set_soap_version = 
+        axis2_soap_envelope_set_soap_version;
+    envelope_impl->soap_envelope.ops->get_namespace = 
+        axis2_soap_envelope_get_namespace;
+    envelope_impl->soap_envelope.ops->set_builder =
+        axis2_soap_envelope_set_builder;
+        
+        
     return &(envelope_impl->soap_envelope);        
 }
 
@@ -234,8 +271,9 @@
                                   axis2_om_node_t *node)
 {
    axis2_soap_envelope_impl_t *envelope_impl = NULL;
-   AXIS2_FUNC_PARAM_CHECK( envelope_impl, env, AXIS2_FAILURE);
+   AXIS2_FUNC_PARAM_CHECK( envelope, env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK((*env)->error, node, AXIS2_FAILURE);
+   
    envelope_impl = AXIS2_INTF_TO_IMPL(envelope);
    
    if(AXIS2_OM_NODE_GET_NODE_TYPE(node, env) != AXIS2_OM_ELEMENT)
@@ -342,10 +380,11 @@
  * @param namespaceURI
  * @param name
  */
-axis2_soap_header_block_t* AXIS2_CALL axis2_soap_envelope_add_header(axis2_soap_envelope_t *envelope,
-    axis2_env_t **env,
-    axis2_char_t *namespace_uri, 
-    axis2_char_t *name)
+axis2_soap_header_block_t* AXIS2_CALL 
+axis2_soap_envelope_add_header(axis2_soap_envelope_t *envelope,
+                                axis2_env_t **env,
+                                axis2_char_t *namespace_uri, 
+                                axis2_char_t *name)
 {
     axis2_soap_envelope_impl_t *envelope_impl = NULL;
     axis2_om_namespace_t *ns = NULL;
@@ -374,8 +413,9 @@
  *                     the <CODE>SOAPBody</CODE> object
  * @throws OMException
  */
-axis2_soap_body_t* AXIS2_CALL axis2_soap_envelope_get_body(axis2_soap_envelope_t *envelope,
-    axis2_env_t **env)
+axis2_soap_body_t* AXIS2_CALL 
+axis2_soap_envelope_get_body(axis2_soap_envelope_t *envelope,
+                            axis2_env_t **env)
 {
     axis2_soap_envelope_impl_t *envelope_impl = NULL;
     axis2_om_element_t *envelope_ele = NULL;
@@ -512,3 +552,16 @@
     }
     return NULL;
 }
+
+axis2_status_t AXIS2_CALL
+axis2_soap_envelope_set_builder(axis2_soap_envelope_t *envelope,
+                                axis2_env_t **env,
+                                axis2_soap_builder_t *soap_builder)
+{
+    axis2_soap_envelope_impl_t *envelope_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(envelope, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, soap_builder, AXIS2_FAILURE);
+    envelope_impl = AXIS2_INTF_TO_IMPL(envelope);
+    envelope_impl->soap_builder = soap_builder;
+    return AXIS2_SUCCESS;
+}                                
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_header.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Sun Jan 15 20:21:28 2006
@@ -112,6 +112,17 @@
     header_impl->om_ele          = NULL;
     header_impl->om_ele_node     = NULL;
     header_impl->hbnumber = 0;
+    
+    header_impl->soap_header.ops = NULL;
+    header_impl->soap_header.ops = (axis2_soap_header_ops_t*)AXIS2_MALLOC((*env)->allocator,
+                                    sizeof(axis2_soap_header_ops_t));
+    if(!(header_impl->soap_header.ops))
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_FREE((*env)->allocator, header_impl);
+        return NULL;
+    }
+    
     header_impl->soap_header.ops->free_fn =
         axis2_soap_header_free;
     header_impl->soap_header.ops->add_header_block =

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_message.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_message.c?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_message.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_message.c Sun Jan 15 20:21:28 2006
@@ -62,6 +62,7 @@
     axis2_soap_message_impl_t *soap_message_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK((*env)->error, om_doc, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, builder, NULL);
     
     soap_message_impl = (axis2_soap_message_impl_t *)AXIS2_MALLOC((*env)->allocator, 
                             sizeof(axis2_soap_message_impl_t));
@@ -162,6 +163,8 @@
 axis2_soap_message_serialize(axis2_soap_message_t *message,
                              axis2_env_t **env)
 {
-    return NULL;
+    axis2_soap_message_impl_t *soap_message_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(message, env, AXIS2_FAILURE);
+    soap_message_impl = AXIS2_INTF_TO_IMPL(message);
 }