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/11 05:19:15 UTC

svn commit: r367912 - in /webservices/axis2/trunk/c: include/ modules/xml/om/ modules/xml/parser/ modules/xml/parser/guththila/ modules/xml/parser/guththila/impl/src/ modules/xml/parser/libxml2/ modules/xml/soap/ test/xml/om/

Author: nandika
Date: Tue Jan 10 20:18:54 2006
New Revision: 367912

URL: http://svn.apache.org/viewcvs?rev=367912&view=rev
Log:
axis2_xml_reader_create_for_memory function changed

Modified:
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/include/axis2_soap_header.h
    webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
    webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_reader.h
    webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c
    webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.c
    webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.h
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/axis2_libxml2_reader_wrapper.c
    webservices/axis2/trunk/c/modules/xml/soap/axis2_soap11_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/axis2_soap12_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.c
    webservices/axis2/trunk/c/test/xml/om/test_om.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=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Tue Jan 10 20:18:54 2006
@@ -364,7 +364,19 @@
         AXIS2_ERROR_INVALID_MODULE,
         AXIS2_ERROR_MODULE_CREATION_FAILED,
         AXIS2_ERROR_SOAP_ENVELOPE_MUST_HAVE_BODY_ELEMENT,
+
         AXIS2_ERROR_INVALID_MODULE_CONF,
+        
+        AXIS2_ERROR_SOAP_MESSAGE_FIRST_ELEMENT_MUST_CONTAIN_LOCAL_NAME,
+        
+        AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_HEADERS_ENCOUNTERED,
+        
+        AXIS2_ERROR_SOAP_BUILDER_HEADER_BODY_WRONG_ORDER,
+        
+        AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_BODY_ELEMENTS_ENCOUNTERED,
+        
+        AXIS2_ERROR_SOAP_BUILDER_ENVELOPE_CAN_HAVE_ONLY_HEADER_AND_BODY,
+
         /* Invalid messge addition , operation context completed */
         AXIS2_ERROR_INVALID_MESSAGE_ADDITION
     };

Modified: webservices/axis2/trunk/c/include/axis2_soap_header.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_header.h?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_header.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_header.h Tue Jan 10 20:18:54 2006
@@ -149,6 +149,14 @@
 AXIS2_DECLARE(axis2_soap_header_t *)
 axis2_soap_header_create_with_parent(axis2_env_t **env,
                                      struct axis2_soap_envelope *envelope);
+                                     
+AXIS2_DECLARE(axis2_soap_header_t *)
+axis2_soap11_header_create_with_parent(axis2_env_t **env,
+                                     axis2_soap_envelope_t *envelope);
+                                     
+AXIS2_DECLARE(axis2_soap_header_t *)
+axis2_soap12_header_create_with_parent(axis2_env_t **env,
+                                     axis2_soap_envelope_t *envelope);                                                                          
                             
 /******************** Macros **************************************************/
     

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=367912&r1=367911&r2=367912&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 Tue Jan 10 20:18:54 2006
@@ -23,9 +23,6 @@
 #include <axis2_xml_writer.h>
 #include <axis2_om_doctype.h>
 
-
-
-
 /**************************** function prototypes *****************************/
 
 axis2_om_node_t * AXIS2_CALL 

Modified: webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_reader.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_reader.h?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_reader.h (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_reader.h Tue Jan 10 20:18:54 2006
@@ -297,7 +297,8 @@
  
 AXIS2_DECLARE(axis2_xml_reader_t *)
 axis2_xml_reader_create_for_memory(axis2_env_t **env,
-                                    int (*read_input_callback)(char *buffer,int size),
+                                    int (*read_input_callback)(char *buffer,int size,void* ctx),
+                                    void *ctx,
                                     const axis2_char_t *encoding);
                                     
 /********************************* Macros *************************************/

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c Tue Jan 10 20:18:54 2006
@@ -248,7 +248,8 @@
 
 AXIS2_DECLARE(axis2_xml_reader_t *)
 axis2_xml_reader_create_for_memory(axis2_env_t **env,
-                                    int (*read_input_callback)(char *buffer,int size),
+                                    int (*read_input_callback)(char *buffer,int size,void* ctx),
+                                    void *ctx,
                                     const char *encoding)
 {
     guththila_xml_reader_wrapper_impl_t *guththila_impl = NULL;
@@ -272,7 +273,7 @@
     
     /*-------difference of two create function is here--------*/
     guththila_impl->reader = 
-        guththila_reader_create_for_memory(guththila_env,read_input_callback); 
+        guththila_reader_create_for_memory(guththila_env,read_input_callback,ctx); 
                                                    
     if(!(guththila_impl->reader))
     {

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.c Tue Jan 10 20:18:54 2006
@@ -63,7 +63,7 @@
 GUTHTHILA_DECLARE(guththila_reader_t *)
 guththila_reader_create_for_memory(
                 guththila_environment_t *environment,
-                int (*input_read_callback)(char *buffer,int size))
+                int (*input_read_callback)(char *buffer,int size,void* ctx),void* ctx)
 {
     guththila_reader_impl_t *memory_reader = 
         (guththila_reader_impl_t *) GUTHTHILA_MALLOC (environment->allocator,

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.h?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.h (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_reader.h Tue Jan 10 20:18:54 2006
@@ -47,7 +47,7 @@
 GUTHTHILA_DECLARE(guththila_reader_t *)
 guththila_reader_create_for_memory(guththila_environment_t *environment,
                                    int (*input_read_callback)
-                                       (char *buffer,int size));
+                                       (char *buffer,int size,void* ctx),void *ctx);
                                    
 GUTHTHILA_DECLARE (int)
 guththila_reader_read (guththila_environment_t * environment,

Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/axis2_libxml2_reader_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/axis2_libxml2_reader_wrapper.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/axis2_libxml2_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/axis2_libxml2_reader_wrapper.c Tue Jan 10 20:18:54 2006
@@ -115,6 +115,8 @@
 	int current_attribute_count;
     int current_namespace_count;
 	int event_map[18];
+	
+	void* ctx;
     /* assuming that max ns and attri will be 20 */
     
     int namespace_map[AXIS2_ATTR_NS_MAX];
@@ -278,7 +280,8 @@
 
 AXIS2_DECLARE(axis2_xml_reader_t *)
 axis2_xml_reader_create_for_memory(axis2_env_t **env,
-                                    int (*read_input_callback)(char *buffer,int size),
+                                    int (*read_input_callback)(char *buffer,int size,void *ctx),
+                                    void* ctx,
                                     const axis2_char_t *encoding)
 {
     
@@ -294,7 +297,7 @@
     }
     
     wrapper_impl->read_input_callback = read_input_callback;
-    
+    wrapper_impl->ctx = ctx;
     wrapper_impl->reader =  xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback,
              NULL, wrapper_impl, NULL, encoding, XML_PARSE_RECOVER);
     
@@ -740,5 +743,6 @@
 
 static int axis2_libxml2_reader_wrapper_read_input_callback(void *ctx,char *buffer,int size)
 {
- return  ((axis2_libxml2_reader_wrapper_impl_t*)ctx)->read_input_callback(buffer, size);
+ return  ((axis2_libxml2_reader_wrapper_impl_t*)ctx)->read_input_callback(
+        buffer, size,((axis2_libxml2_reader_wrapper_impl_t*)ctx)->ctx);
 }

Modified: webservices/axis2/trunk/c/modules/xml/soap/axis2_soap11_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/axis2_soap11_builder_helper.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/axis2_soap11_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/axis2_soap11_builder_helper.c Tue Jan 10 20:18:54 2006
@@ -37,7 +37,7 @@
  
  /********************* Macro *************************************************/
 
-#define AXIS2_INFT_TO_IMPL(builder_helper) \
+#define AXIS2_INTF_TO_IMPL(builder_helper) \
         ((axis2_soap11_builder_helper_impl_t*)builder_helper)
 
 /********************* function implementations *******************************/
@@ -98,7 +98,7 @@
 {
     axis2_soap11_builder_helper_impl_t *builder_helper_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, AXIS2_FAILURE);
-    builder_helper_impl = AXIS2_INFT_TO_IMPL(builder_helper);
+    builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
 
    
     if(builder_helper_impl->builder_helper.ops)
@@ -122,7 +122,7 @@
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, NULL);\
     AXIS2_PARAM_CHECK((*env)->error, om_builder, NULL);
     AXIS2_PARAM_CHECK((*env)->error, element_level, NULL);
-    builder_helper_impl = AXIS2_INFT_TO_IMPL(builder_helper);
+    builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
     
     
     

Modified: webservices/axis2/trunk/c/modules/xml/soap/axis2_soap12_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/axis2_soap12_builder_helper.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/axis2_soap12_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/axis2_soap12_builder_helper.c Tue Jan 10 20:18:54 2006
@@ -52,7 +52,7 @@
 
 /******************** Macro ***************************************************/
 
-#define AXIS2_INFT_TO_IMPL(builder_helper) ((axis2_soap12_builder_helper_impl_t*)builder_helper)
+#define AXIS2_INTF_TO_IMPL(builder_helper) ((axis2_soap12_builder_helper_impl_t*)builder_helper)
 
 /******************** function prototypes *************************************/
 
@@ -119,7 +119,7 @@
 {
     axis2_soap12_builder_helper_impl_t *builder_helper_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, AXIS2_FAILURE);
-    builder_helper_impl = AXIS2_INFT_TO_IMPL(builder_helper);
+    builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
 
     if(builder_helper_impl->detail_element_names)
     {
@@ -145,7 +145,7 @@
 {
     axis2_soap12_builder_helper_impl_t *builder_helper_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, NULL);
-    builder_helper_impl = AXIS2_INFT_TO_IMPL(builder_helper);
+    builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
 
 
     return NULL;

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.c Tue Jan 10 20:18:54 2006
@@ -17,7 +17,10 @@
  #include <axis2_soap_model_builder.h>
  #include <axis2_soap_message.h>
  #include <axis2_soap_envelope.h>
- 
+ #include <axis2_soap_header.h>
+ #include <axis2_soap11_builder_helper.h>
+ #include <axis2_soap12_builder_helper.h>
+ #include <axis2_soap.h>
  
  /*********************** impl struct *****************************************/
  
@@ -51,8 +54,18 @@
     
     int soap_version;
     
+    int last_node_status;
+    
+    
 }axis2_soap_model_builder_impl_t;
 
+typedef enum axis2_builder_last_node_states
+{
+    AXIS2_BUILDER_LAST_NODE_NULL = 0,
+    AXIS2_BUILDER_LAST_NODE_DONE_TRUE,
+    AXIS2_BUILDER_LAST_NODE_DONE_FALSE
+}axis2_builder_last_node_states;
+
 /***************** Macro ******************************************************/
 
  #define AXIS2_INTF_TO_IMPL(builder) ((axis2_soap_model_builder_impl_t*)builder)
@@ -82,7 +95,32 @@
                                 (axis2_soap_model_builder_t *builder,
                                  axis2_env_t **env); 
                                  
-static void identify_soap_version(axis2_char_t* soap_version_uri_from_transport);
+axis2_om_node_t *axis2_soap_model_builder_create_om_element
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t **env);
+                                 
+axis2_status_t axis2_soap_model_builder_process_namespace_data
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t *env,
+                                 axis2_om_node_t *om_node,
+                                 int is_soap_element);
+
+static axis2_status_t
+axis2_soap_model_builder_end_element(axis2_soap_model_builder_t *builder,
+                                     axis2_env_t **env);
+                                                                      
+                                 
+static void 
+identify_soap_version(axis2_soap_model_builder_t *builder,
+                      axis2_env_t **env,
+                      axis2_char_t* soap_version_uri_from_transport);
+                      
+static axis2_om_node_t* 
+axis2_soap_builder_construct_node(axis2_soap_model_builder_t *builder,
+                                axis2_env_t **env,
+                                axis2_om_node_t *parent,
+                                axis2_om_node_t *element_node,
+                                axis2_bool_t is_soap_envelope);                      
 
 
 static void parse_headers();
@@ -116,18 +154,244 @@
     builder_impl->receiver_fault_code = NULL;
     builder_impl->sender_fault_code = NULL;
     builder_impl->soap_builder.ops = NULL;
+    builder_impl->last_node_status = -1;
     
     builder_impl->soap_builder.ops = (axis2_soap_model_builder_ops_t*)
             AXIS2_MALLOC((*env)->allocator, sizeof(axis2_soap_model_builder_ops_t));
+    if(!(builder_impl->soap_builder.ops))
+    {
+        AXIS2_FREE((*env)->allocator, builder_impl);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
     
+    builder_impl->om_builder = builder;
+    builder_impl->soap_builder.ops->free = 
+            axis2_soap_model_builder_free;
+    builder_impl->soap_builder.ops->next =
+            axis2_soap_model_builder_next;
+    builder_impl->soap_builder.ops->get_soap_envelope =
+            axis2_soap_model_builder_get_soap_envelope;
+    builder_impl->soap_builder.ops->get_document =
+            axis2_soap_model_builder_get_document;                                   
+
+    return &(builder_impl->soap_builder);    
+} 
+
+axis2_status_t AXIS2_CALL 
+axis2_soap_model_builder_free(axis2_soap_model_builder_t *builder,
+                              axis2_env_t **env)
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FAILURE);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    if(builder->ops)
+    {
+        AXIS2_FREE((*env)->allocator, builder->ops);
+    }
+    AXIS2_FREE((*env)->allocator, builder_impl);
+    return AXIS2_SUCCESS;
+}
+                              
+
+axis2_soap_envelope_t* AXIS2_CALL 
+axis2_soap_model_builder_get_soap_envelope
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t **env)
+                                 {}
+                                
+axis2_om_document_t* AXIS2_CALL 
+axis2_soap_model_builder_get_document
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t **env)
+                                 {}
+                                
+axis2_om_node_t * AXIS2_CALL
+axis2_soap_model_builder_next(axis2_soap_model_builder_t *builder,
+                              axis2_env_t **env)
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    axis2_om_node_t *lastnode = NULL;
+    axis2_om_node_t *current_node =  NULL;
+    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);
+    if(!lastnode)
+    {
+        builder_impl->last_node_status = AXIS2_BUILDER_LAST_NODE_NULL;
+    }else if(AXIS2_OM_NODE_GET_BUILD_STATUS(lastnode, env))
+    {
+        builder_impl->last_node_status = AXIS2_BUILDER_LAST_NODE_DONE_TRUE;
+    }else
+    {
+        builder_impl->last_node_status = AXIS2_BUILDER_LAST_NODE_NULL;
+    }
     
+    current_node = AXIS2_OM_STAX_BUILDER_NEXT(builder_impl->om_builder, env);
+    if(AXIS2_OM_STAX_BUILDER_GET_CURRENT_EVENT(builder_impl->om_builder, env) == 
+            AXIS2_XML_READER_EMPTY_ELEMENT || AXIS2_XML_READER_START_ELEMENT)
+    {
+        axis2_soap_model_builder_create_om_element(builder, env);
+        axis2_soap_model_builder_end_element(builder, env);
     
+    }            
+    return current_node;
+}
+                                    
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_model_builder_get_document_element
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t **env)
+                                 {} 
+                                       
+static axis2_status_t
+axis2_soap_model_builder_end_element(axis2_soap_model_builder_t *builder,
+                                     axis2_env_t **env){}                                                          
+                                     
+axis2_om_node_t *
+axis2_soap_model_builder_create_om_element
+                                (axis2_soap_model_builder_t *builder,
+                                 axis2_env_t **env)
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK( builder, env, NULL);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
     
+
+
+
+}   
+
+static axis2_om_node_t* 
+axis2_soap_builder_construct_node(axis2_soap_model_builder_t *builder,
+                                axis2_env_t **env,
+                                axis2_om_node_t *parent,
+                                axis2_om_node_t *om_element_node,
+                                axis2_bool_t is_soap_envelope)
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    axis2_om_element_t *parent_ele  = NULL;
+    axis2_char_t *parent_localname = NULL;
+    axis2_char_t *element_name = NULL;
+    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);
     
+    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(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);
+        AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(builder_impl->soap_envelope, env, builder_impl->soap_version);
     
-    
-    
-    
-    
-    
-}                                
\ No newline at end of file
+    }
+    else if(builder_impl->element_level == 2)
+    {
+        axis2_soap_header_t *soap_header = NULL;
+        if(AXIS2_STRCMP(element_name, AXIS2_SOAP_HEADER_LOCAL_NAME) == 0)
+        {
+            if(builder_impl->header_present)
+            {
+                AXIS2_ERROR_SET((*env)->error, 
+                    AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_HEADERS_ENCOUNTERED, AXIS2_FAILURE);
+                    return NULL;
+            }
+            if(builder_impl->body_present)
+            {
+                AXIS2_ERROR_SET((*env)->error,
+                    AXIS2_ERROR_SOAP_BUILDER_HEADER_BODY_WRONG_ORDER, AXIS2_FAILURE);
+                return  NULL;                                              
+            }
+            builder_impl->header_present = AXIS2_TRUE;
+            soap_header = axis2_soap_header_create(env);
+            AXIS2_SOAP_HEADER_SET_BASE_NODE(soap_header, env, om_element_node);
+            AXIS2_SOAP_HEADER_SET_SOAP_VERSION(soap_header, env, builder_impl->soap_version);
+
+            
+        }
+        else if(AXIS2_STRCMP(element_name, AXIS2_SOAP_BODY_LOCAL_NAME))
+        {
+            if(builder_impl->body_present)
+            {
+                AXIS2_ERROR_SET((*env)->error, 
+                    AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_BODY_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE);
+                return NULL;                   
+            
+            }
+            builder_impl->body_present = AXIS2_TRUE;                
+            om_element = axis2_om_element_create (env , parent, element_name, NULL, &om_element_node);
+                    
+        }else
+        {
+            AXIS2_ERROR_SET((*env)->error,
+                    AXIS2_ERROR_SOAP_BUILDER_ENVELOPE_CAN_HAVE_ONLY_HEADER_AND_BODY, AXIS2_FAILURE);
+            return NULL;                                            
+        }
+    }
+    /*
+    else if((builder_impl->element_level == 3) && AXIS2_STRCASECMP(parent_localname, 
+            AXIS2_SOAP_HEADER_LOCAL_NAME) == 0)
+    {
+            om_ele = axis2_om_element_create (env , parent, element_name, NULL, &om_ele_node);
+            AXIS2_BUILDER_PROCESS_NAMESPACES(builder, env, om_ele_node, AXIS2_TRUE);
+            axis2_builder_process_attributes(builder, env, om_ele_node);
+    }else if((builder_impl->element_level == 3) && 
+            AXIS2_STRCASECMP(parent_localname, AXIS2_SOAP_BODY_LOCAL_NAME) == 0 &&
+                AXIS2_STRCASECMP(element_name, AXIS2_SOAP_BODY_FAULT_LOCAL_NAME) == 0)
+    {
+            axis2_soap_body_t *soap_body = NULL;
+            void *soap_fault = NULL;
+            AXIS2_SOAP_ENVELOPE_GET_BODY(builder_impl->soap_envelope, env);
+            om_ele = axis2_om_element_create (env , parent, element_name, NULL, &om_ele_node);
+            AXIS2_BUILDER_PROCESS_NAMESPACES(builder, env, om_ele_node, AXIS2_TRUE);
+            axis2_builder_process_attributes(builder, env, om_ele_node);  
+            
+            builder_impl->processing_fault = TRUE;
+            builder_impl->processing_mandatory_fault_elements = AXIS2_TRUE; 
+            if(AXIS2_STRCMP(AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, 
+                AXIS2_OM_NAMESPACE_GET_URI(builder_impl->envelope_namespace, env)) == 0)
+            {
+                builder_impl->builder_helper = axis2_soap12_builder_helper_create(env, builder); 
+             
+            }
+            else if(AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, 
+                AXIS2_OM_NAMESPACE_GET_URI(builder_impl->envelope_namespace, env)) == 0)
+            {
+                builder_impl->builder_helper = axis2_soap12_builder_helper_create(env, builder);            
+            }                
+    }else if(builder_impl->element_level > 3 && builder_impl->processing_fault)
+    {
+        if(builder_impl->builder_type == AXIS2_SOAP11)
+        {
+            om_ele_node = AXIS2_SOAP11_BUILDER_HELPER_HANDLE_EVENT(((axis2_soap11_builder_helper_t*)(builder_impl->builder_helper)), 
+                env, element_name, parent, builder_impl->element_level);
+        
+        }
+        if(builder_impl->builder_type == AXIS2_SOAP12)
+        {
+            om_ele_node = AXIS2_SOAP12_BUILDER_HELPER_HANDLE_EVENT(((axis2_soap12_builder_helper_t *)(builder_impl->builder_helper)), 
+                env, element_name, parent, builder_impl->element_level);
+        
+        }
+    }else
+    {
+        om_ele = axis2_om_element_create (env , parent, element_name, NULL, &om_ele_node);
+                    
+            AXIS2_BUILDER_PROCESS_NAMESPACES(builder, env, om_ele_node, AXIS2_FALSE);
+            axis2_builder_process_attributes(builder, env, om_ele_node);
+    }
+    */
+    return om_element_node;
+}                                                                                 
\ No newline at end of file

Modified: webservices/axis2/trunk/c/test/xml/om/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/xml/om/test_om.c?rev=367912&r1=367911&r2=367912&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/om/test_om.c (original)
+++ webservices/axis2/trunk/c/test/xml/om/test_om.c Tue Jan 10 20:18:54 2006
@@ -40,7 +40,7 @@
 /** a method that demonstrate creating a om model using an xml file */
 
 
-int read_input(char *buffer,int size)
+int read_input(char *buffer,int size,void* ctx)
 {
    return fread(buffer, sizeof(char),size,f);
 }
@@ -63,7 +63,7 @@
         return -1;
       
     /** create pull parser */
-     reader = axis2_xml_reader_create_for_memory(&environment, read_input, NULL);
+     reader = axis2_xml_reader_create_for_memory(&environment, read_input, NULL, NULL);
     
     if(!reader)
     {