axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r395818 - in /webservices/axis2/trunk/c: include/ modules/core/clientapi/ modules/xml/parser/libxml2/ modules/xml/soap/
Date Fri, 21 Apr 2006 09:02:27 GMT
Author: nandika
Date: Fri Apr 21 02:02:25 2006
New Revision: 395818

URL: http://svn.apache.org/viewcvs?rev=395818&view=rev
Log:
AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION moved to _axis2_soap_envelope.h and new function added
to soap_envelope axis2_soap_envelope_create_with_soap_version_prefix

Modified:
    webservices/axis2/trunk/c/include/axis2_soap_envelope.h
    webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c
    webservices/axis2/trunk/c/modules/xml/soap/_axis2_soap_envelope.h
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c

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=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Fri Apr 21 02:02:25 2006
@@ -121,14 +121,6 @@
 		get_soap_version)(axis2_soap_envelope_t *envelope,
                           axis2_env_t **env);
                    
-        /**
-         * set soap version, This is internal function do not use outside of soap
-         */         
-        axis2_status_t (AXIS2_CALL *
-		set_soap_version)(axis2_soap_envelope_t *envelope,
-                          axis2_env_t **env,
-                          int soap_version);
-     
         /** return the soap envelope namespace 
          * @param envelope 
          * @param env 
@@ -159,6 +151,21 @@
 axis2_soap_envelope_create(axis2_env_t **env, 
 						   axis2_om_namespace_t *ns);
 
+ /**
+  * @param env Environment. MUST NOT be NULL
+  * create a soap_envelope with the given namespace prefix and uri is selected 
+  * according to soap_version, soap version should be one of AXIS2_SOAP11
+  * or AXIS2_SOAP12
+  * @param prefix soap envelope prefix
+  * if prefix is NULL default prefix is used
+  * @returns a pointer to soap envelope struct
+  * 
+  */						   
+AXIS2_DECLARE(axis2_soap_envelope_t*)
+axis2_soap_envelope_create_with_soap_version_prefix(axis2_env_t **env,
+                                                    int soap_version,
+                                                    axis2_char_t *prefix);						   
+
 AXIS2_DECLARE(axis2_soap_envelope_t *)
 axis2_soap_envelope_create_default_soap_envelope(axis2_env_t **env,
                                                  int soap_version);
@@ -188,9 +195,6 @@
 
 #define AXIS2_SOAP_ENVELOPE_GET_SOAP_VERSION(envelope, env) \
         ((envelope)->ops->get_soap_version(envelope, env))
-
-#define AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(envelope, env, soap_version) \
-        ((envelope)->ops->set_soap_version(envelope, env, soap_version))
 
 #define AXIS2_SOAP_ENVELOPE_GET_NAMESPACE(envelope, env) \
         ((envelope)->ops->get_namespace(envelope, env))

Modified: webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c?rev=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c Fri Apr 21 02:02:25 2006
@@ -314,20 +314,12 @@
     
     if (AXIS2_STRCMP(AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, mep_client_impl->soap_version_uri)
== 0) 
     {
-        envelope = axis2_soap_envelope_create(env, NULL);
-        if (envelope)
-        {
-            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(envelope, env, AXIS2_SOAP12);
-        }
+        envelope = axis2_soap_envelope_create_with_soap_version_prefix(env, AXIS2_SOAP12,NULL);
     }
     
     if (AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, mep_client_impl->soap_version_uri)
== 0) 
     {
-        envelope = axis2_soap_envelope_create(env, NULL);
-        if (envelope)
-        {
-            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(envelope, env, AXIS2_SOAP11);
-        }
+        envelope = axis2_soap_envelope_create_with_soap_version_prefix(env, AXIS2_SOAP11,NULL);
     }
     return envelope;
 }

Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c?rev=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c Fri Apr
21 02:02:25 2006
@@ -132,6 +132,10 @@
                                                  
 static int 
 axis2_libxml2_reader_wrapper_close_input_callback(void *ctx);
+
+static void
+axis2_libxml2_reader_wrapper_init_ops(axis2_xml_reader_t *reader);
+
                                    
 /************* End function parameters , axis2_libxml2_reader_wrapper_impl_t struct ***/
 
@@ -216,7 +220,50 @@
     return AXIS2_FAILURE;
 }
 
-
+static void
+axis2_libxml2_reader_wrapper_init_ops(axis2_xml_reader_t *parser)
+{
+   parser->ops->free = 
+        axis2_libxml2_reader_wrapper_free;
+   parser->ops->next = 
+        axis2_libxml2_reader_wrapper_next;
+   parser->ops->xml_free = 
+        axis2_libxml2_reader_wrapper_xml_free;
+   parser->ops->get_attribute_count =
+        axis2_libxml2_reader_wrapper_get_attribute_count;
+   parser->ops->get_attribute_name_by_number =
+        axis2_libxml2_reader_wrapper_get_attribute_name_by_number;
+   parser->ops->get_attribute_value_by_number = 
+        axis2_libxml2_reader_wrapper_get_attribute_value_by_number;
+   parser->ops->get_attribute_namespace_by_number =
+        axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number;
+   parser->ops->get_attribute_prefix_by_number =
+        axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number;
+   parser->ops->get_value =
+        axis2_libxml2_reader_wrapper_get_value;
+   parser->ops->get_prefix =
+        axis2_libxml2_reader_wrapper_get_prefix;
+   parser->ops->get_name =
+        axis2_libxml2_reader_wrapper_get_name;
+   parser->ops->get_namespace_count =
+        axis2_libxml2_reader_wrapper_get_namespace_count;
+   parser->ops->get_namespace_prefix_by_number =
+        axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number;
+   parser->ops->get_namespace_uri_by_number =
+        axis2_libxml2_reader_wrapper_get_namespace_uri_by_number;
+   parser->ops->get_pi_target =
+        axis2_libxml2_reader_wrapper_get_pi_target;
+   parser->ops->get_pi_data =
+        axis2_libxml2_reader_wrapper_get_pi_data;
+   parser->ops->get_dtd =
+        axis2_libxml2_reader_wrapper_get_dtd;
+   parser->ops->get_char_set_encoding =
+        axis2_libxml2_reader_wrapper_get_char_set_encoding;            
+   parser->ops->get_namespace_uri = 
+        axis2_libxml2_reader_wrapper_get_namespace_uri;
+   parser->ops->get_namespace_uri_by_prefix = 
+        axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix;           
+}
 
 
 /*******************************************************************************/
@@ -281,53 +328,7 @@
         return NULL;
     }
 	/* ops */
-	
-	wrapper_impl->parser.ops->free = axis2_libxml2_reader_wrapper_free;
-    wrapper_impl->parser.ops->next = axis2_libxml2_reader_wrapper_next;
-    wrapper_impl->parser.ops->xml_free = axis2_libxml2_reader_wrapper_xml_free;
-    
-    wrapper_impl->parser.ops->get_attribute_count =
-        axis2_libxml2_reader_wrapper_get_attribute_count;
-    wrapper_impl->parser.ops->get_attribute_name_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_name_by_number;
-    wrapper_impl->parser.ops->get_attribute_value_by_number = 
-        axis2_libxml2_reader_wrapper_get_attribute_value_by_number;
-    wrapper_impl->parser.ops->get_attribute_namespace_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number;
-    wrapper_impl->parser.ops->get_attribute_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number;
-    
-    wrapper_impl->parser.ops->get_value =
-        axis2_libxml2_reader_wrapper_get_value;
-    wrapper_impl->parser.ops->get_prefix =
-        axis2_libxml2_reader_wrapper_get_prefix;
-    wrapper_impl->parser.ops->get_name =
-        axis2_libxml2_reader_wrapper_get_name;
-        
-        
-    wrapper_impl->parser.ops->get_namespace_count =
-        axis2_libxml2_reader_wrapper_get_namespace_count;
-    wrapper_impl->parser.ops->get_namespace_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number;
-    wrapper_impl->parser.ops->get_namespace_uri_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_number;
-        
-    wrapper_impl->parser.ops->get_pi_target =
-        axis2_libxml2_reader_wrapper_get_pi_target;
-    wrapper_impl->parser.ops->get_pi_data =
-        axis2_libxml2_reader_wrapper_get_pi_data;
-        
-    wrapper_impl->parser.ops->get_dtd =
-        axis2_libxml2_reader_wrapper_get_dtd;
-        
-    wrapper_impl->parser.ops->get_char_set_encoding =
-        axis2_libxml2_reader_wrapper_get_char_set_encoding;            
-        
-    wrapper_impl->parser.ops->get_namespace_uri = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri;
-        
-    wrapper_impl->parser.ops->get_namespace_uri_by_prefix = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix;           
+	axis2_libxml2_reader_wrapper_init_ops(&(wrapper_impl->parser));
 	return &(wrapper_impl->parser);
 }
 
@@ -400,54 +401,7 @@
         return NULL;
     }
 
-	
-	wrapper_impl->parser.ops->free = axis2_libxml2_reader_wrapper_free;
-    wrapper_impl->parser.ops->next = axis2_libxml2_reader_wrapper_next;
-    wrapper_impl->parser.ops->xml_free = axis2_libxml2_reader_wrapper_xml_free;
-    
-    wrapper_impl->parser.ops->get_attribute_count =
-        axis2_libxml2_reader_wrapper_get_attribute_count;
-    wrapper_impl->parser.ops->get_attribute_name_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_name_by_number;
-    wrapper_impl->parser.ops->get_attribute_value_by_number = 
-        axis2_libxml2_reader_wrapper_get_attribute_value_by_number;
-    wrapper_impl->parser.ops->get_attribute_namespace_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number;
-    wrapper_impl->parser.ops->get_attribute_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number;
-    
-    wrapper_impl->parser.ops->get_value =
-        axis2_libxml2_reader_wrapper_get_value;
-    wrapper_impl->parser.ops->get_prefix =
-        axis2_libxml2_reader_wrapper_get_prefix;
-    wrapper_impl->parser.ops->get_name =
-        axis2_libxml2_reader_wrapper_get_name;
-        
-        
-    wrapper_impl->parser.ops->get_namespace_count =
-        axis2_libxml2_reader_wrapper_get_namespace_count;
-    wrapper_impl->parser.ops->get_namespace_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number;
-    wrapper_impl->parser.ops->get_namespace_uri_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_number;
-        
-    wrapper_impl->parser.ops->get_pi_target =
-        axis2_libxml2_reader_wrapper_get_pi_target;
-    wrapper_impl->parser.ops->get_pi_data =
-        axis2_libxml2_reader_wrapper_get_pi_data;
-        
-    wrapper_impl->parser.ops->get_dtd =
-        axis2_libxml2_reader_wrapper_get_dtd;
-        
-    wrapper_impl->parser.ops->get_char_set_encoding =
-        axis2_libxml2_reader_wrapper_get_char_set_encoding;     
-        
-    wrapper_impl->parser.ops->get_namespace_uri = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri;
-        
-    wrapper_impl->parser.ops->get_namespace_uri_by_prefix = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix; 
-                       
+	axis2_libxml2_reader_wrapper_init_ops(&(wrapper_impl->parser));
 	return &(wrapper_impl->parser);
 }
 
@@ -505,54 +459,7 @@
         return NULL;
     }
 
-	
-	wrapper_impl->parser.ops->free = axis2_libxml2_reader_wrapper_free;
-    wrapper_impl->parser.ops->next = axis2_libxml2_reader_wrapper_next;
-    wrapper_impl->parser.ops->xml_free = axis2_libxml2_reader_wrapper_xml_free;
-    
-    wrapper_impl->parser.ops->get_attribute_count =
-        axis2_libxml2_reader_wrapper_get_attribute_count;
-    wrapper_impl->parser.ops->get_attribute_name_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_name_by_number;
-    wrapper_impl->parser.ops->get_attribute_value_by_number = 
-        axis2_libxml2_reader_wrapper_get_attribute_value_by_number;
-    wrapper_impl->parser.ops->get_attribute_namespace_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number;
-    wrapper_impl->parser.ops->get_attribute_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number;
-    
-    wrapper_impl->parser.ops->get_value =
-        axis2_libxml2_reader_wrapper_get_value;
-    wrapper_impl->parser.ops->get_prefix =
-        axis2_libxml2_reader_wrapper_get_prefix;
-    wrapper_impl->parser.ops->get_name =
-        axis2_libxml2_reader_wrapper_get_name;
-        
-        
-    wrapper_impl->parser.ops->get_namespace_count =
-        axis2_libxml2_reader_wrapper_get_namespace_count;
-    wrapper_impl->parser.ops->get_namespace_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number;
-    wrapper_impl->parser.ops->get_namespace_uri_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_number;
-        
-    wrapper_impl->parser.ops->get_pi_target =
-        axis2_libxml2_reader_wrapper_get_pi_target;
-    wrapper_impl->parser.ops->get_pi_data =
-        axis2_libxml2_reader_wrapper_get_pi_data;
-        
-    wrapper_impl->parser.ops->get_dtd =
-        axis2_libxml2_reader_wrapper_get_dtd;
-        
-    wrapper_impl->parser.ops->get_char_set_encoding =
-        axis2_libxml2_reader_wrapper_get_char_set_encoding;
-        
-    wrapper_impl->parser.ops->get_namespace_uri = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri;
-        
-    wrapper_impl->parser.ops->get_namespace_uri_by_prefix = 
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix; 
-                            
+	axis2_libxml2_reader_wrapper_init_ops(&(wrapper_impl->parser));
 	return &(wrapper_impl->parser);
 }
 
@@ -607,48 +514,8 @@
         return NULL;
     }
 
+	axis2_libxml2_reader_wrapper_init_ops(&(wrapper_impl->parser));
 	
-	wrapper_impl->parser.ops->free = axis2_libxml2_reader_wrapper_free;
-    wrapper_impl->parser.ops->next = axis2_libxml2_reader_wrapper_next;
-    wrapper_impl->parser.ops->xml_free = axis2_libxml2_reader_wrapper_xml_free;
-    
-    wrapper_impl->parser.ops->get_attribute_count =
-        axis2_libxml2_reader_wrapper_get_attribute_count;
-    wrapper_impl->parser.ops->get_attribute_name_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_name_by_number;
-    wrapper_impl->parser.ops->get_attribute_value_by_number = 
-        axis2_libxml2_reader_wrapper_get_attribute_value_by_number;
-    wrapper_impl->parser.ops->get_attribute_namespace_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number;
-    wrapper_impl->parser.ops->get_attribute_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number;
-    
-    wrapper_impl->parser.ops->get_value =
-        axis2_libxml2_reader_wrapper_get_value;
-    wrapper_impl->parser.ops->get_prefix =
-        axis2_libxml2_reader_wrapper_get_prefix;
-    wrapper_impl->parser.ops->get_name =
-        axis2_libxml2_reader_wrapper_get_name;
-        
-        
-    wrapper_impl->parser.ops->get_namespace_count =
-        axis2_libxml2_reader_wrapper_get_namespace_count;
-    wrapper_impl->parser.ops->get_namespace_prefix_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number;
-    wrapper_impl->parser.ops->get_namespace_uri_by_number =
-        axis2_libxml2_reader_wrapper_get_namespace_uri_by_number;
-        
-    wrapper_impl->parser.ops->get_pi_target =
-        axis2_libxml2_reader_wrapper_get_pi_target;
-    wrapper_impl->parser.ops->get_pi_data =
-        axis2_libxml2_reader_wrapper_get_pi_data;
-        
-    wrapper_impl->parser.ops->get_dtd =
-        axis2_libxml2_reader_wrapper_get_dtd;
-        
-    wrapper_impl->parser.ops->get_char_set_encoding =
-		axis2_libxml2_reader_wrapper_get_char_set_encoding;
-
 	return &(wrapper_impl->parser);
 }
 /****************** end create functions ***************************************/

Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c?rev=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c Fri Apr
21 02:02:25 2006
@@ -319,7 +319,10 @@
 axis2_libxml2_writer_wrapper_find_prefix_in_context(
                             axis2_array_list_t  *context,
                             axis2_env_t **env,
-                            axis2_char_t *uri);  
+                            axis2_char_t *uri); 
+                            
+static void
+axis2_libxml2_writer_wrapper_init_ops(axis2_xml_writer_t *writer);                      
      
   
 /**************************** end function pointers ****************************/
 
@@ -402,93 +405,7 @@
         return NULL;
     }
     /* ops */
-    writer_impl->writer.ops->free = 
-            axis2_libxml2_writer_wrapper_free;
-        
-    writer_impl->writer.ops->write_start_element = 
-            axis2_libxml2_writer_wrapper_write_start_element;
-        
-    writer_impl->writer.ops->write_start_element_with_namespace =
-            axis2_libxml2_writer_wrapper_write_start_element_with_namespace;
-            
-    writer_impl->writer.ops->write_start_element_with_namespace_prefix = 
-            axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix;
-    
-    writer_impl->writer.ops->write_empty_element = 
-            axis2_libxml2_writer_wrapper_write_empty_element;
-        
-    writer_impl->writer.ops->write_empty_element_with_namespace  =
-            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace;
-            
-    writer_impl->writer.ops->write_empty_element_with_namespace_prefix =
-            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix;
-    
-    writer_impl->writer.ops->write_end_element = 
-            axis2_libxml2_writer_wrapper_write_end_element;
-            
-    writer_impl->writer.ops->write_end_document = 
-            axis2_libxml2_writer_wrapper_write_end_document;
-    
-    writer_impl->writer.ops->write_attribute = 
-            axis2_libxml2_writer_wrapper_write_attribute;
-            
-    writer_impl->writer.ops->write_attribute_with_namespace =
-            axis2_libxml2_writer_wrapper_write_attribute_with_namespace;
-            
-    writer_impl->writer.ops->write_attribute_with_namespace_prefix =
-            axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix;
-            
-    writer_impl->writer.ops->write_namespace = 
-            axis2_libxml2_writer_wrapper_write_namespace;
-            
-    writer_impl->writer.ops->write_default_namespace =
-            axis2_libxml2_writer_wrapper_write_default_namespace;
-            
-    writer_impl->writer.ops->write_comment = 
-            axis2_libxml2_writer_wrapper_write_comment;
-            
-    writer_impl->writer.ops->write_processing_instruction = 
-            axis2_libxml2_writer_wrapper_write_processing_instruction;
-            
-    writer_impl->writer.ops->write_processing_instruction_data = 
-            axis2_libxml2_writer_wrapper_write_processing_instruction_data;
-            
-    writer_impl->writer.ops->write_cdata = 
-            axis2_libxml2_writer_wrapper_write_cdata;
-            
-    writer_impl->writer.ops->write_dtd = 
-            axis2_libxml2_writer_wrapper_write_dtd;
-            
-    writer_impl->writer.ops->write_entity_ref = 
-            axis2_libxml2_writer_wrapper_write_entity_ref;
-            
-    writer_impl->writer.ops->write_start_document = 
-            axis2_libxml2_writer_wrapper_write_start_document;
-            
-    writer_impl->writer.ops->write_start_document_with_version = 
-            axis2_libxml2_writer_wrapper_write_start_document_with_version;
-            
-    writer_impl->writer.ops->write_start_document_with_version_encoding = 
-            axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding;
-            
-    writer_impl->writer.ops->write_characters = 
-            axis2_libxml2_writer_wrapper_write_characters;
-            
-    writer_impl->writer.ops->get_prefix =
-            axis2_libxml2_writer_wrapper_get_prefix;
-            
-    writer_impl->writer.ops->set_prefix = 
-            axis2_libxml2_writer_wrapper_set_prefix;
-            
-    writer_impl->writer.ops->set_default_prefix = 
-            axis2_libxml2_writer_wrapper_set_default_prefix;
-            
-    writer_impl->writer.ops->write_encoded = 
-            axis2_libxml2_writer_wrapper_write_encoded; 
-               
-    writer_impl->writer.ops->get_xml =
-            axis2_libxml2_writer_wrapper_get_xml;    
-                    
+    axis2_libxml2_writer_wrapper_init_ops(&(writer_impl->writer));
     return &(writer_impl->writer);
 }
 
@@ -575,93 +492,8 @@
     }
     
     /* ops */
-    writer_impl->writer.ops->free = 
-            axis2_libxml2_writer_wrapper_free;
-            
-    writer_impl->writer.ops->write_start_element = 
-            axis2_libxml2_writer_wrapper_write_start_element;
-            
-    writer_impl->writer.ops->write_start_element_with_namespace =
-            axis2_libxml2_writer_wrapper_write_start_element_with_namespace;
-            
-    writer_impl->writer.ops->write_start_element_with_namespace_prefix = 
-            axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix;
-    
-    writer_impl->writer.ops->write_empty_element =
-            axis2_libxml2_writer_wrapper_write_empty_element;
-            
-    writer_impl->writer.ops->write_empty_element_with_namespace  =
-            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace;
-            
-    writer_impl->writer.ops->write_empty_element_with_namespace_prefix =
-            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix;
-    
-    writer_impl->writer.ops->write_end_element = 
-            axis2_libxml2_writer_wrapper_write_end_element;
-            
-    writer_impl->writer.ops->write_end_document = 
-            axis2_libxml2_writer_wrapper_write_end_document;
-    
-    writer_impl->writer.ops->write_attribute = 
-            axis2_libxml2_writer_wrapper_write_attribute;
-            
-    writer_impl->writer.ops->write_attribute_with_namespace =
-            axis2_libxml2_writer_wrapper_write_attribute_with_namespace;
-            
-    writer_impl->writer.ops->write_attribute_with_namespace_prefix =
-            axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix;
-            
-    writer_impl->writer.ops->write_namespace = 
-            axis2_libxml2_writer_wrapper_write_namespace;
-            
-    writer_impl->writer.ops->write_default_namespace =
-            axis2_libxml2_writer_wrapper_write_default_namespace;
-            
-    writer_impl->writer.ops->write_comment = 
-            axis2_libxml2_writer_wrapper_write_comment;
-            
-    writer_impl->writer.ops->write_processing_instruction = 
-            axis2_libxml2_writer_wrapper_write_processing_instruction;
-            
-    writer_impl->writer.ops->write_processing_instruction_data = 
-            axis2_libxml2_writer_wrapper_write_processing_instruction_data;
-            
-    writer_impl->writer.ops->write_cdata = 
-            axis2_libxml2_writer_wrapper_write_cdata;
-            
-    writer_impl->writer.ops->write_dtd = 
-            axis2_libxml2_writer_wrapper_write_dtd;
-            
-    writer_impl->writer.ops->write_entity_ref = 
-            axis2_libxml2_writer_wrapper_write_entity_ref;
-            
-    writer_impl->writer.ops->write_start_document = 
-            axis2_libxml2_writer_wrapper_write_start_document;
-            
-    writer_impl->writer.ops->write_start_document_with_version = 
-            axis2_libxml2_writer_wrapper_write_start_document_with_version;
-            
-    writer_impl->writer.ops->write_start_document_with_version_encoding = 
-            axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding;
-            
-    writer_impl->writer.ops->write_characters = 
-            axis2_libxml2_writer_wrapper_write_characters;
-            
-    writer_impl->writer.ops->get_prefix =
-            axis2_libxml2_writer_wrapper_get_prefix;
-            
-    writer_impl->writer.ops->set_prefix = 
-            axis2_libxml2_writer_wrapper_set_prefix;
-            
-    writer_impl->writer.ops->set_default_prefix = 
-            axis2_libxml2_writer_wrapper_set_default_prefix;
-            
-    writer_impl->writer.ops->write_encoded = 
-            axis2_libxml2_writer_wrapper_write_encoded;
-            
-    writer_impl->writer.ops->get_xml =
-            axis2_libxml2_writer_wrapper_get_xml;
-                             
+    axis2_libxml2_writer_wrapper_init_ops(&(writer_impl->writer));
+
     return &(writer_impl->writer);
 }
 
@@ -832,6 +664,70 @@
 }
 
 /*******************************************************************************/
+static void
+axis2_libxml2_writer_wrapper_init_ops(axis2_xml_writer_t *writer)
+{
+    writer->ops->free = 
+            axis2_libxml2_writer_wrapper_free;
+    writer->ops->write_start_element = 
+            axis2_libxml2_writer_wrapper_write_start_element;
+    writer->ops->write_start_element_with_namespace =
+            axis2_libxml2_writer_wrapper_write_start_element_with_namespace;
+    writer->ops->write_start_element_with_namespace_prefix = 
+            axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix;
+    writer->ops->write_empty_element =
+            axis2_libxml2_writer_wrapper_write_empty_element;
+    writer->ops->write_empty_element_with_namespace  =
+            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace;
+    writer->ops->write_empty_element_with_namespace_prefix =
+            axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix;
+    writer->ops->write_end_element = 
+            axis2_libxml2_writer_wrapper_write_end_element;
+    writer->ops->write_end_document = 
+            axis2_libxml2_writer_wrapper_write_end_document;
+    writer->ops->write_attribute = 
+            axis2_libxml2_writer_wrapper_write_attribute;
+    writer->ops->write_attribute_with_namespace =
+            axis2_libxml2_writer_wrapper_write_attribute_with_namespace;
+    writer->ops->write_attribute_with_namespace_prefix =
+            axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix;
+    writer->ops->write_namespace = 
+            axis2_libxml2_writer_wrapper_write_namespace;
+    writer->ops->write_default_namespace =
+            axis2_libxml2_writer_wrapper_write_default_namespace;
+    writer->ops->write_comment = 
+            axis2_libxml2_writer_wrapper_write_comment;
+    writer->ops->write_processing_instruction = 
+            axis2_libxml2_writer_wrapper_write_processing_instruction;
+    writer->ops->write_processing_instruction_data = 
+            axis2_libxml2_writer_wrapper_write_processing_instruction_data;
+    writer->ops->write_cdata = 
+            axis2_libxml2_writer_wrapper_write_cdata;
+    writer->ops->write_dtd = 
+            axis2_libxml2_writer_wrapper_write_dtd;
+    writer->ops->write_entity_ref = 
+            axis2_libxml2_writer_wrapper_write_entity_ref;
+    writer->ops->write_start_document = 
+            axis2_libxml2_writer_wrapper_write_start_document;
+    writer->ops->write_start_document_with_version = 
+            axis2_libxml2_writer_wrapper_write_start_document_with_version;
+    writer->ops->write_start_document_with_version_encoding = 
+            axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding;
+    writer->ops->write_characters = 
+            axis2_libxml2_writer_wrapper_write_characters;
+    writer->ops->get_prefix =
+            axis2_libxml2_writer_wrapper_get_prefix;
+    writer->ops->set_prefix = 
+            axis2_libxml2_writer_wrapper_set_prefix;
+    writer->ops->set_default_prefix = 
+            axis2_libxml2_writer_wrapper_set_default_prefix;
+    writer->ops->write_encoded = 
+            axis2_libxml2_writer_wrapper_write_encoded;
+    writer->ops->get_xml =
+            axis2_libxml2_writer_wrapper_get_xml;
+}
+
+
 axis2_status_t AXIS2_CALL 
 axis2_libxml2_writer_wrapper_free(axis2_xml_writer_t *writer,
                                   axis2_env_t **env)

Modified: webservices/axis2/trunk/c/modules/xml/soap/_axis2_soap_envelope.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/_axis2_soap_envelope.h?rev=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/_axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/_axis2_soap_envelope.h Fri Apr 21 02:02:25
2006
@@ -57,6 +57,11 @@
 axis2_soap_envelope_set_builder(axis2_soap_envelope_t *envelope,
                                 axis2_env_t **env,
                                 struct axis2_soap_builder *soap_builder); 
+                                
+axis2_status_t AXIS2_CALL 
+axis2_soap_envelope_set_soap_version(axis2_soap_envelope_t *envelope,
+                                   axis2_env_t **env,
+                                   int soap_version);                                
 
 AXIS2_DECLARE(axis2_soap_envelope_t*)
 axis2_soap_envelope_create_null(axis2_env_t **env);

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=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Fri Apr 21 02:02:25 2006
@@ -771,7 +771,7 @@
       
             AXIS2_LOG_DEBUG((*env)->log, AXIS2_LOG_SI, "Identified soap version is soap11");
 
-            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(builder_impl->soap_envelope, 
+            axis2_soap_envelope_set_soap_version(builder_impl->soap_envelope, 
                 env, builder_impl->soap_version);        
 
             return AXIS2_SUCCESS;
@@ -782,7 +782,7 @@
         
             AXIS2_LOG_DEBUG((*env)->log, AXIS2_LOG_SI, "identified soap version is soap12");
             
-            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(builder_impl->soap_envelope, 
+            axis2_soap_envelope_set_soap_version(builder_impl->soap_envelope, 
                 env, builder_impl->soap_version);        
 
             return AXIS2_SUCCESS;                

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=395818&r1=395817&r2=395818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Fri Apr 21 02:02:25 2006
@@ -84,10 +84,6 @@
 int AXIS2_CALL 
 axis2_soap_envelope_get_soap_version(axis2_soap_envelope_t *envelope,
                                    axis2_env_t **env);
-axis2_status_t AXIS2_CALL 
-axis2_soap_envelope_set_soap_version(axis2_soap_envelope_t *envelope,
-                                   axis2_env_t **env,
-                                   int soap_version);
                                    
 axis2_om_namespace_t* AXIS2_CALL 
 axis2_soap_envelope_get_namespace(axis2_soap_envelope_t *envelope,
@@ -137,16 +133,12 @@
 
     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->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_namespace = 
             axis2_soap_envelope_get_namespace;
@@ -163,25 +155,16 @@
                            axis2_om_namespace_t *ns)
 {
     axis2_soap_envelope_impl_t *envelope_impl = NULL;
+    axis2_soap_envelope_t *envelope = NULL;
     axis2_om_element_t *ele = NULL;
     int status = AXIS2_SUCCESS;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK((*env)->error, ns, NULL);
     
-    envelope_impl = (axis2_soap_envelope_impl_t*)AXIS2_MALLOC(
-                    (*env)->allocator,
-                    sizeof(axis2_soap_envelope_impl_t));
-    if(!envelope_impl)
-    {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-    envelope_impl->soap_envelope.ops = NULL;
-    envelope_impl->om_ele_node = NULL;
-    envelope_impl->soap_version = AXIS2_SOAP12;    
-    envelope_impl->header = NULL;
-    envelope_impl->body = NULL;
-    envelope_impl->soap_builder =  NULL;
+    envelope = axis2_soap_envelope_create_null(env);
+    if(!envelope)
+        return NULL;        
+    envelope_impl = AXIS2_INTF_TO_IMPL(envelope);
     
     status =  check_and_set_soap_version(&(envelope_impl->soap_envelope), env, ns);
     if(status == AXIS2_FAILURE)
@@ -189,7 +172,7 @@
         AXIS2_FREE((*env)->allocator, envelope_impl); 
         return NULL; 
     }
- 
+     
     ele = axis2_om_element_create(env, NULL, 
                                   AXIS2_SOAP_ENVELOPE_LOCAL_NAME, ns, 
                                   &(envelope_impl->om_ele_node));
@@ -199,40 +182,46 @@
         axis2_soap_envelope_free(&(envelope_impl->soap_envelope), env);
         return NULL;
     }
-    
-    envelope_impl->soap_envelope.ops  = AXIS2_MALLOC( (*env)->allocator, 
-                                        sizeof(axis2_soap_envelope_ops_t) );
-    if (!envelope_impl->soap_envelope.ops)
+    return &(envelope_impl->soap_envelope);        
+}
+
+AXIS2_DECLARE(axis2_soap_envelope_t*)
+axis2_soap_envelope_create_with_soap_version_prefix(axis2_env_t **env,
+                                                    int soap_version,
+                                                    axis2_char_t *prefix)
+{
+    axis2_soap_envelope_t *envelope = NULL;
+    axis2_om_namespace_t *ns        = NULL;
+    axis2_char_t *ns_prefix = NULL;
+    axis2_char_t *ns_uri    = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    if(soap_version == AXIS2_SOAP11)
     {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_soap_envelope_free(&(envelope_impl->soap_envelope), env);
-        return NULL;        
+        ns_uri = AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
+    }
+    else if(soap_version == AXIS2_SOAP12)
+    {
+        ns_uri = AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
+    }
+    else
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_SOAP_VERSION, AXIS2_FAILURE);
+        return NULL;
+    }
+    if(!prefix || AXIS2_STRCMP(prefix, "") == 0)
+    {
+        ns_prefix = AXIS2_SOAP_DEFAULT_NAMESPACE_PREFIX;
+    }    
+    else
+    {
+        ns_prefix = prefix;
     }
-
-    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_body = 
-            axis2_soap_envelope_get_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_namespace = 
-            axis2_soap_envelope_get_namespace;
-
-    envelope_impl->soap_envelope.ops->serialize = 
-            axis2_soap_envelope_serialize;    
     
-    return &(envelope_impl->soap_envelope);        
-}
+    ns = axis2_om_namespace_create(env, ns_uri, ns_prefix);
+    if(!ns)
+        return NULL;
+    return axis2_soap_envelope_create(env, ns);
+}                                                    
 
 axis2_status_t AXIS2_CALL
 axis2_soap_envelope_free(axis2_soap_envelope_t *envelope,
@@ -318,28 +307,6 @@
     axis2_soap_envelope_impl_t *envelope_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     envelope_impl = AXIS2_INTF_TO_IMPL(envelope);
-
-    /*
-    if(envelope_impl->soap_version && envelope_impl->soap_version != soap_version)
-    {
-        axis2_om_namespace_t *om_ns    = NULL;
-        axis2_char_t *uri              = NULL;
-        axis2_om_element_t *env_ele    = 
-            AXIS2_OM_NODE_GET_DATA_ELEMENT(envelope_impl->om_ele_node, env);
-        
-        om_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(env_ele, env);
-        
-        if(om_ns )
-           AXIS2_OM_NAMESPACE_FREE(om_ns, env);
-        
-        if(soap_version == AXIS2_SOAP11)
-            uri = AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
-        else if(soap_version == AXIS2_SOAP12)
-            uri = AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;                             
             
-        om_ns = axis2_om_namespace_create(env, uri, AXIS2_SOAP_DEFAULT_NAMESPACE_PREFIX);
-        AXIS2_OM_ELEMENT_SET_NAMESPACE(env_ele, env, om_ns, envelope_impl->om_ele_node);
-    }
-    */
     envelope_impl->soap_version = soap_version;
     return AXIS2_SUCCESS;
 }
@@ -693,7 +660,7 @@
         soap_env = axis2_soap_envelope_create(env, om_ns);
         env_impl = AXIS2_INTF_TO_IMPL(soap_env);
         
-        AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(soap_env, env, AXIS2_SOAP11);
+        axis2_soap_envelope_set_soap_version(soap_env, env, AXIS2_SOAP11);
         soap_header = axis2_soap_header_create_with_parent(env, soap_env);
         soap_body   = axis2_soap_body_create_with_parent(env, soap_env);
         env_impl->body = soap_body;
@@ -710,7 +677,7 @@
         soap_env = axis2_soap_envelope_create(env, om_ns);
         env_impl = AXIS2_INTF_TO_IMPL(soap_env);
         
-        AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(soap_env, env, AXIS2_SOAP12);
+        axis2_soap_envelope_set_soap_version(soap_env, env, AXIS2_SOAP12);
         soap_header = axis2_soap_header_create_with_parent(env, soap_env);
         soap_body   = axis2_soap_body_create_with_parent(env, soap_env);
         env_impl->body = soap_body;



Mime
View raw message