axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r367990 - in /webservices/axis2/trunk/c: include/ modules/xml/om/ modules/xml/soap/
Date Wed, 11 Jan 2006 10:05:46 GMT
Author: nandika
Date: Wed Jan 11 02:05:25 2006
New Revision: 367990

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

Modified:
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
    webservices/axis2/trunk/c/include/axis2_soap11_builder_helper.h
    webservices/axis2/trunk/c/include/axis2_soap12_builder_helper.h
    webservices/axis2/trunk/c/include/axis2_soap_envelope.h
    webservices/axis2/trunk/c/include/axis2_soap_header.h
    webservices/axis2/trunk/c/include/axis2_soap_header_block.h
    webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.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_envelope.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_model_builder.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=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Wed Jan 11 02:05:25 2006
@@ -378,7 +378,9 @@
         AXIS2_ERROR_SOAP_BUILDER_ENVELOPE_CAN_HAVE_ONLY_HEADER_AND_BODY,
 
         /* Invalid messge addition , operation context completed */
-        AXIS2_ERROR_INVALID_MESSAGE_ADDITION
+        AXIS2_ERROR_INVALID_MESSAGE_ADDITION,
+        
+        AXIS2_ERROR_INVALID_SOAP_NAMESPACE_URI
     };
 
 /** @} */

Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Wed Jan 11 02:05:25 2006
@@ -118,6 +118,10 @@
         axis2_om_node_t* (AXIS2_CALL *get_last_node)
                                             (struct axis2_om_stax_builder* builder,
                                              axis2_env_t **env);
+                                             
+        axis2_bool_t (AXIS2_CALL *is_complete)(struct axis2_om_stax_builder* builder,
+                                               axis2_env_t **env);
+                                                                                        
   
                                                                                         
                                                                 
                                                            
     } axis2_om_stax_builder_ops_t;
@@ -163,7 +167,10 @@
         ((builder)->ops->get_current_event(builder, env))
         
 #define AXIS2_OM_STAX_BUILDER_GET_LAST_NODE(builder, env) \
-        ((builder)->ops->get_last_node(builder, env))                
+        ((builder)->ops->get_last_node(builder, env)) 
+        
+#define AXIS2_OM_STAX_BUILDER_IS_COMPLETE(builder, env) \
+        ((builder)->ops->is_complete(builder, env))                       
 	
 /** @} */
 

Modified: webservices/axis2/trunk/c/include/axis2_soap11_builder_helper.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap11_builder_helper.h?rev=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap11_builder_helper.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap11_builder_helper.h Wed Jan 11 02:05:25 2006
@@ -52,7 +52,8 @@
         axis2_om_node_t* (AXIS2_CALL *handle_event)
                     (axis2_soap11_builder_helper_t *builder_helper,
                      axis2_env_t **env,
-                     axis2_om_stax_builder_t *om_builder,
+                     axis2_soap_model_builder_t *soap_builder,
+                     axis2_om_node_t *om_element_node,
                      int element_level);
     };                                                      
 
@@ -79,9 +80,9 @@
         ((builder_helper)->ops->free(builder_helper, env))
         
 #define AXIS2_SOAP11_BUILDER_HELPER_HANDLE_EVENT(builder_helper, \
-            env, element_level) \
+            env, soap_builder, om_element_node, element_level) \
         ((builder_helper)->ops->handle_event(builder_helper, \
-            env, om_builder, element_level))
+            env, soap_builder, om_element_node,  element_level))
         
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/include/axis2_soap12_builder_helper.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap12_builder_helper.h?rev=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap12_builder_helper.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap12_builder_helper.h Wed Jan 11 02:05:25 2006
@@ -49,10 +49,11 @@
                              axis2_env_t **env);
         
         axis2_om_node_t* (AXIS2_CALL *handle_event)
-                            (axis2_soap12_builder_helper_t *builder_helper,
-                             axis2_env_t **env,
-                             axis2_om_stax_builder_t *om_builder,
-                             int element_level);
+                    (axis2_soap12_builder_helper_t *builder_helper,
+                     axis2_env_t **env,
+                     axis2_soap_model_builder_t *soap_builder,
+                     axis2_om_node_t *om_element_node,
+                     int element_level);
     };                                                      
 
   /**
@@ -78,9 +79,9 @@
         ((builder_helper)->ops->free(builder_helper, env))
         
 #define AXIS2_SOAP12_BUILDER_HELPER_HANDLE_EVENT(builder_helper, \
-                env, element_level) \
+            env, soap_builder, om_element_node,  element_level) \
         ((builder_helper)->ops->handle_event(builder_helper, \
-                env, om_builder, element_level))
+            env, soap_builder, om_element_node,  element_level))
         
 /** @} */
 #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=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Wed Jan 11 02:05:25 2006
@@ -73,11 +73,13 @@
          * @param namespaceURI
          * @param name
          */
-        struct axis2_soap_header_block* (AXIS2_CALL *add_header)
+         /*
+        struct axis2* (AXIS2_CALL *add_header)
                                             (axis2_soap_envelope_t *envelope,
                                              axis2_env_t **env,
                                              axis2_char_t *namespace_uri, 
                                              axis2_char_t *name);
+        */                                             
         /**
          * Returns the <CODE>SOAPBody</CODE> object associated with this
          * <CODE>SOAPEnvelope</CODE> object. <P> This SOAPBody will just
be a
@@ -157,12 +159,12 @@
                            
 /******************** Macros **************************************************/
 
-#define AXIS2_SOAP_ENVELOPE_GET_HEADDER(envelope, env) \
+#define AXIS2_SOAP_ENVELOPE_GET_HEADER(envelope, env) \
         ((envelope)->ops->get_header(envelope, env))
-        
+/*        
 #define AXIS2_SOAP_ENVELOPE_ADD_HEADER(envelope, env, namespace_uri, name) \
         ((envelope)->ops->add_header(envelope, env, namespace_uri, name))
-        
+*/        
 #define AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env) \
         ((envelope)->ops->get_body(envelope, env))
         

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=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_header.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_header.h Wed Jan 11 02:05:25 2006
@@ -123,7 +123,12 @@
         axis2_status_t (AXIS2_CALL *set_soap_version)
                                             (axis2_soap_header_t *header,
                                              axis2_env_t **env,
-                                             int soap_version);                         
                                                                                         
                                                                                   
+                                             int soap_version); 
+                                             
+        axis2_status_t (AXIS2_CALL *set_header_block)
+                                            (axis2_soap_header_t *header,
+                                             axis2_env_t **env,
+                                             struct axis2_soap_header_block* header_block);
                                                                                         
                                                                                         
                                                              
                                          
     };
 
@@ -188,6 +193,9 @@
         
 #define AXIS2_SOAP_HEADER_GET_SOAP_VERSION(header, env) \
         ((header)->ops->get_soap_version(header, env))
+        
+#define AXIS2_SOAP_HEADER_SET_HEADER_BLOCK(header, env, header_block) \
+        ((header)->ops->set_header_block(header, env, header_block))        
 
 /** @} */
 

Modified: webservices/axis2/trunk/c/include/axis2_soap_header_block.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_header_block.h?rev=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_header_block.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_header_block.h Wed Jan 11 02:05:25 2006
@@ -124,7 +124,9 @@
         int (AXIS2_CALL *set_soap_version)  
                             (axis2_soap_header_block_t *header_block,
                              axis2_env_t **env,
-                             int soap_version);                                         
                           
+                             int soap_version);
+                             
+                                                                                        
                
     };
 
   /**

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=367990&r1=367989&r2=367990&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 Wed Jan 11 02:05:25 2006
@@ -51,7 +51,11 @@
 axis2_om_node_t*  AXIS2_CALL
 axis2_om_stax_builder_get_lastnode(axis2_om_stax_builder_t *builder,
                                    axis2_env_t **env);
-                           											
+      
+axis2_bool_t  AXIS2_CALL
+axis2_om_stax_builder_is_complete(axis2_om_stax_builder_t *builder,
+                                   axis2_env_t **env);
+                                                              											
 int AXIS2_CALL
 axis2_om_stax_builder_get_current_event(axis2_om_stax_builder_t *builder,
                                         axis2_env_t **env);                           		
								
@@ -138,7 +142,9 @@
 	builder->om_stax_builder.ops->get_current_event =
 	        axis2_om_stax_builder_get_current_event;
     builder->om_stax_builder.ops->get_last_node = 
-            axis2_om_stax_builder_get_lastnode;	        
+            axis2_om_stax_builder_get_lastnode;	
+    builder->om_stax_builder.ops->is_complete =
+            axis2_om_stax_builder_is_complete;                    
 	
     return &(builder->om_stax_builder);
 }
@@ -607,7 +613,8 @@
 axis2_om_stax_builder_end_element (axis2_om_stax_builder_t *om_stax_builder,
                                    axis2_env_t **env)
 {
-    axis2_om_node_t *parent;
+    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 );
@@ -630,10 +637,10 @@
             AXIS2_OM_NODE_SET_BUILD_STATUS((builder->lastnode), env, AXIS2_TRUE);
         }
     }
- /*   root_node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(builder->document, env);
+    root_node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(builder->document, env);
     if(AXIS2_OM_NODE_GET_BUILD_STATUS(root_node, env))
         builder->done = AXIS2_TRUE;
-   */
+   
     return AXIS2_SUCCESS;
 }
 
@@ -794,4 +801,14 @@
 {
     AXIS2_FUNC_PARAM_CHECK(builder, env, NULL);
     return AXIS2_INTF_TO_IMPL(builder)->lastnode;   
-}                                                                           
+}
+
+axis2_bool_t  AXIS2_CALL
+axis2_om_stax_builder_is_complete(axis2_om_stax_builder_t *builder,
+                                   axis2_env_t **env)
+{
+    axis2_om_stax_builder_impl_t *builder_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FALSE);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    return builder_impl->done;    
+}                                                                                       
                      

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=367990&r1=367989&r2=367990&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 Wed Jan 11 02:05:25
2006
@@ -47,10 +47,11 @@
                                  axis2_env_t **env);
 
 axis2_om_node_t* AXIS2_CALL 
-axis2_soap11_builder_helper_handle_event(axis2_soap11_builder_helper_t *builder_helper,
-                                         axis2_env_t **env,
-                                         axis2_om_stax_builder_t* om_builder,
-                                         int element_level);
+axis2_soap11_builder_helper_handle_event (axis2_soap11_builder_helper_t *builder_helper,
+                             axis2_env_t **env,
+                             axis2_soap_model_builder_t *soap_builder,
+                             axis2_om_node_t *om_element_node,
+                             int element_level);
 
 AXIS2_DECLARE(axis2_soap11_builder_helper_t*)
 axis2_soap11_builder_helper_create(axis2_env_t **env, 
@@ -113,14 +114,15 @@
 }                                 
 
 axis2_om_node_t* AXIS2_CALL 
-axis2_soap11_builder_helper_handle_event(axis2_soap11_builder_helper_t *builder_helper,
-                                         axis2_env_t **env,
-                                         axis2_om_stax_builder_t *om_builder,
-                                         int element_level)
+axis2_soap11_builder_helper_handle_event (axis2_soap11_builder_helper_t *builder_helper,
+                             axis2_env_t **env,
+                             axis2_soap_model_builder_t *soap_builder,
+                             axis2_om_node_t *om_element_node,
+                             int element_level)
 {
     axis2_soap11_builder_helper_impl_t *builder_helper_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, NULL);\
-    AXIS2_PARAM_CHECK((*env)->error, om_builder, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, soap_builder , NULL);
     AXIS2_PARAM_CHECK((*env)->error, element_level, NULL);
     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=367990&r1=367989&r2=367990&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 Wed Jan 11 02:05:25
2006
@@ -64,7 +64,8 @@
 axis2_soap12_builder_helper_handle_event
                             (axis2_soap12_builder_helper_t *builder_helper,
                              axis2_env_t **env,
-                             axis2_om_stax_builder_t *om_builder,
+                             axis2_soap_model_builder_t *soap_builder,
+                             axis2_om_node_t *om_element_node,
                              int element_level);
                              
 /******************** function implementations ********************************/
@@ -138,10 +139,11 @@
 }                                 
 
 axis2_om_node_t* AXIS2_CALL 
-axis2_soap12_builder_helper_handle_event(axis2_soap12_builder_helper_t *builder_helper,
-                                         axis2_env_t **env,
-                                         axis2_om_stax_builder_t *om_builder,
-                                         int element_level)
+axis2_soap12_builder_helper_handle_event (axis2_soap12_builder_helper_t *builder_helper,
+                             axis2_env_t **env,
+                             axis2_soap_model_builder_t *soap_builder,
+                             axis2_om_node_t *om_element_node,
+                             int element_level)
 {
     axis2_soap12_builder_helper_impl_t *builder_helper_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, NULL);

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=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Wed Jan 11 02:05:25 2006
@@ -131,7 +131,7 @@
     }
     
     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->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;
@@ -139,6 +139,8 @@
     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;
     
     return &(envelope_impl->soap_envelope);        
 }
@@ -182,7 +184,7 @@
     }
     
     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->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;

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=367990&r1=367989&r2=367990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Wed Jan 11 02:05:25 2006
@@ -89,6 +89,10 @@
                                    axis2_env_t **env,
                                    int soap_version);                                   
                                                                                         
                                                                         
 
+axis2_status_t AXIS2_CALL 
+axis2_soap_header_set_header_block(axis2_soap_header_t *header,
+                                   axis2_env_t **env,
+                                   struct axis2_soap_header_block *header_block); 
 /*************** function implementations *************************************/
 
 AXIS2_DECLARE(axis2_soap_header_t *)
@@ -126,6 +130,9 @@
         axis2_soap_header_set_soap_version;
     header_impl->soap_header.ops->get_soap_version =
         axis2_soap_header_get_soap_version;
+    header_impl->soap_header.ops->set_header_block = 
+        axis2_soap_header_set_header_block;
+            
     return &(header_impl->soap_header);        
 }
 
@@ -370,4 +377,28 @@
     return header;
 }
 
-
+axis2_status_t AXIS2_CALL 
+axis2_soap_header_set_header_block(axis2_soap_header_t *header,
+                                   axis2_env_t **env,
+                                   struct axis2_soap_header_block *header_block)
+{
+    axis2_char_t key[10];
+    axis2_soap_header_impl_t *header_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(header, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, header_block, AXIS2_FAILURE);
+    header_impl = AXIS2_INTF_TO_IMPL(header);
+    sprintf(key,"%d", header_impl->hbnumber++);
+    if(header_impl->header_blocks)
+    {
+        axis2_hash_set(header_impl->header_blocks,
+             key , AXIS2_HASH_KEY_STRING, header_block);
+    }
+    else
+    {
+            header_impl->header_blocks = axis2_hash_make(env);
+            axis2_hash_set(header_impl->header_blocks,
+                key , AXIS2_HASH_KEY_STRING, header_block);
+    }
+    return AXIS2_SUCCESS;
+        
+}                                   

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=367990&r1=367989&r2=367990&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 Wed Jan 11 02:05:25 2006
@@ -21,6 +21,8 @@
  #include <axis2_soap11_builder_helper.h>
  #include <axis2_soap12_builder_helper.h>
  #include <axis2_soap.h>
+ #include <axis2_soap_body.h>
+ #include <axis2_soap_header_block.h>
  
  /*********************** impl struct *****************************************/
  
@@ -52,6 +54,8 @@
     
     void *builder_helper;
     
+    axis2_om_namespace_t *envelope_ns;
+    
     int soap_version;
     
     int last_node_status;
@@ -97,11 +101,13 @@
                                  
 axis2_om_node_t *axis2_soap_model_builder_create_om_element
                                 (axis2_soap_model_builder_t *builder,
-                                 axis2_env_t **env);
+                                 axis2_env_t **env,
+                                 axis2_om_node_t *current_node);
                                  
-axis2_status_t axis2_soap_model_builder_process_namespace_data
+axis2_status_t 
+axis2_soap_model_builder_process_namespace_data
                                 (axis2_soap_model_builder_t *builder,
-                                 axis2_env_t *env,
+                                 axis2_env_t **env,
                                  axis2_om_node_t *om_node,
                                  int is_soap_element);
 
@@ -116,7 +122,7 @@
                       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_soap_model_builder_construct_node(axis2_soap_model_builder_t *builder,
                                 axis2_env_t **env,
                                 axis2_om_node_t *parent,
                                 axis2_om_node_t *element_node,
@@ -155,6 +161,7 @@
     builder_impl->sender_fault_code = NULL;
     builder_impl->soap_builder.ops = NULL;
     builder_impl->last_node_status = -1;
+    builder_impl->envelope_ns = NULL;
     
     builder_impl->soap_builder.ops = (axis2_soap_model_builder_ops_t*)
             AXIS2_MALLOC((*env)->allocator, sizeof(axis2_soap_model_builder_ops_t));
@@ -198,13 +205,28 @@
 axis2_soap_model_builder_get_soap_envelope
                                 (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);
+    while(!(builder_impl->soap_envelope) || 
+        !AXIS2_OM_STAX_BUILDER_IS_COMPLETE(builder_impl->om_builder, env))
+    {
+        axis2_soap_model_builder_next(builder, env);
+    }        
+    return builder_impl->soap_envelope;
+}
                                 
 axis2_om_document_t* AXIS2_CALL 
 axis2_soap_model_builder_get_document
                                 (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);
+    return AXIS2_OM_STAX_BUILDER_GET_DOCUMENT(builder_impl->om_builder, env);
+ }
                                 
 axis2_om_node_t * AXIS2_CALL
 axis2_soap_model_builder_next(axis2_soap_model_builder_t *builder,
@@ -231,7 +253,7 @@
     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_create_om_element(builder, env, current_node);
         axis2_soap_model_builder_end_element(builder, env);
     
     }            
@@ -242,28 +264,56 @@
 axis2_soap_model_builder_get_document_element
                                 (axis2_soap_model_builder_t *builder,
                                  axis2_env_t **env)
-                                 {} 
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    axis2_om_document_t *om_doc = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, NULL);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    return AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(builder_impl->soap_envelope, env);
+} 
                                        
 static axis2_status_t
 axis2_soap_model_builder_end_element(axis2_soap_model_builder_t *builder,
-                                     axis2_env_t **env){}                               
                          
+                                     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);
+    builder_impl->element_level--;
+    return AXIS2_SUCCESS;
+}                                                          
                                      
 axis2_om_node_t *
 axis2_soap_model_builder_create_om_element
                                 (axis2_soap_model_builder_t *builder,
-                                 axis2_env_t **env)
+                                 axis2_env_t **env,
+                                 axis2_om_node_t *current_node)
 {
     axis2_soap_model_builder_impl_t *builder_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK( builder, env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, current_node, NULL);
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    builder_impl->element_level++;
+    if(builder_impl->last_node_status == AXIS2_BUILDER_LAST_NODE_NULL)
+    {
+        axis2_soap_model_builder_construct_node(builder, env, NULL, current_node, TRUE);
+         
+    }else if(builder_impl->last_node_status == AXIS2_BUILDER_LAST_NODE_DONE_TRUE)
+    {
+        axis2_soap_model_builder_construct_node(builder, env, 
+            AXIS2_OM_NODE_GET_PARENT(current_node, env), current_node, AXIS2_FALSE);
     
-
-
-
+    }
+    else
+    {
+       axis2_soap_model_builder_construct_node(builder, env, 
+            AXIS2_OM_NODE_GET_PARENT(current_node, env), current_node, AXIS2_FALSE);
+    }
+    return current_node;  
 }   
 
 static axis2_om_node_t* 
-axis2_soap_builder_construct_node(axis2_soap_model_builder_t *builder,
+axis2_soap_model_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,
@@ -295,7 +345,7 @@
         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);
-    
+        axis2_soap_model_builder_process_namespace_data(builder, env, om_element_node, AXIS2_TRUE);
     }
     else if(builder_impl->element_level == 2)
     {
@@ -318,11 +368,12 @@
             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);
-
-            
+            AXIS2_SOAP_ENVELOPE_SET_HEADER(builder_impl->soap_envelope, env, soap_header);
+            axis2_soap_model_builder_process_namespace_data(builder, env, om_element_node,
AXIS2_TRUE);
         }
         else if(AXIS2_STRCMP(element_name, AXIS2_SOAP_BODY_LOCAL_NAME))
         {
+            axis2_soap_body_t *soap_body = NULL;
             if(builder_impl->body_present)
             {
                 AXIS2_ERROR_SET((*env)->error, 
@@ -331,7 +382,11 @@
             
             }
             builder_impl->body_present = AXIS2_TRUE;                
-            om_element = axis2_om_element_create (env , parent, element_name, NULL, &om_element_node);
+            soap_body = axis2_soap_body_create(env);
+            AXIS2_SOAP_BODY_SET_BASE_NODE(soap_body, env, om_element_node);
+            AXIS2_SOAP_BODY_SET_SOAP_VERSION(soap_body, env, builder_impl->soap_version);
+            AXIS2_SOAP_ENVELOPE_SET_BODY(builder_impl->soap_envelope, env, soap_body);
+            axis2_soap_model_builder_process_namespace_data(builder, env, om_element_node,
AXIS2_TRUE);
                     
         }else
         {
@@ -340,58 +395,89 @@
             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_soap_header_block_t *header_block = NULL;
+            axis2_soap_header_t *soap_header = NULL;
+            header_block = axis2_soap_header_block_create(env);
+            AXIS2_SOAP_HEADER_BLOCK_SET_BASE_NODE(header_block, env, om_element_node);
+            AXIS2_SOAP_HEADER_BLOCK_SET_SOAP_VERSION(header_block, env, builder_impl->soap_version);
+            soap_header = AXIS2_SOAP_ENVELOPE_GET_HEADER(builder_impl->soap_envelope,
env);
+            AXIS2_SOAP_HEADER_SET_HEADER_BLOCK(soap_header, env, header_block);
+
+    }
+    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);  
-            
+            axis2_soap_fault_t *soap_fault = NULL;
+            soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(builder_impl->soap_envelope, env);
+            soap_fault = axis2_soap_fault_create(env);
+            AXIS2_SOAP_FAULT_SET_BASE_NODE(soap_fault, env, om_element_node);
+            AXIS2_SOAP_FAULT_SET_SOAP_VERSION(soap_fault, env, builder_impl->soap_version);
+            AXIS2_SOAP_BODY_ADD_FAULT(soap_body, env, soap_fault);                    
+                                
             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)
+                AXIS2_OM_NAMESPACE_GET_URI(builder_impl->envelope_ns, 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)
+                AXIS2_OM_NAMESPACE_GET_URI(builder_impl->envelope_ns, 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)
+        if(builder_impl->soap_version == 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);
+             AXIS2_SOAP11_BUILDER_HELPER_HANDLE_EVENT(((axis2_soap11_builder_helper_t*)(builder_impl->builder_helper)),

+                env, builder, om_element_node , builder_impl->element_level);
         
         }
-        if(builder_impl->builder_type == AXIS2_SOAP12)
+        if(builder_impl->soap_version == 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);
-        
+            AXIS2_SOAP12_BUILDER_HELPER_HANDLE_EVENT(((axis2_soap12_builder_helper_t *)(builder_impl->builder_helper)),

+                env, builder, om_element_node , 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
+}
+
+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)
+{
+    axis2_soap_model_builder_impl_t *builder_impl = NULL;
+    axis2_om_element_t *om_ele = NULL;
+    axis2_om_namespace_t *om_ns = NULL;
+    axis2_char_t *ns_uri = NULL;
+    AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, om_node, AXIS2_FAILURE);
+    if(!is_soap_element)
+        return AXIS2_SUCCESS;
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    if(AXIS2_OM_NODE_GET_NODE_TYPE(om_node, env) == AXIS2_OM_ELEMENT)
+    {
+        om_ele = (axis2_om_element_t *) AXIS2_OM_NODE_GET_DATA_ELEMENT(om_node, env);
+        om_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(om_ele, env);
+        ns_uri = AXIS2_OM_NAMESPACE_GET_URI(om_ns, env);
+        if(om_ns && 
+                AXIS2_STRCMP(ns_uri, AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) != 0 ||
+                AXIS2_STRCMP(ns_uri, AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI) != 0)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_SOAP_NAMESPACE_URI, AXIS2_FAILURE);
               
+            return AXIS2_FAILURE;
+        }
+    }    
+    return AXIS2_SUCCESS;
+}                                                                                       
                          
\ No newline at end of file



Mime
View raw message