You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/02/12 12:20:09 UTC

svn commit: r377156 - in /webservices/axis2/trunk/c/modules: core/receivers/raw_xml_in_out_msg_recv.c xml/soap/soap_envelope.c xml/soap/soap_header.c

Author: samisa
Date: Sun Feb 12 03:20:06 2006
New Revision: 377156

URL: http://svn.apache.org/viewcvs?rev=377156&view=rev
Log:
Fixed more bugs to get addressing working. 
There was a problem in setting header and body in the envelope in message receiver.
There were bugs in assigning the mutator functions in soap envelope.
Also the soap version in soap header was not handled properly

Modified:
    webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_header.c

Modified: webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c?rev=377156&r1=377155&r2=377156&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c Sun Feb 12 03:20:06 2006
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <axis2_om_element.h>
 #include <axis2_soap_envelope.h>
+#include <axis2_soap_header.h>
 #include <axis2_soap_body.h>
 #include <axis2_soap_fault.h>
 
@@ -77,6 +78,7 @@
     axis2_om_element_t *body_content_element = NULL;
     axis2_soap_envelope_t *default_envelope = NULL;
     axis2_soap_body_t *out_body = NULL;
+    axis2_soap_header_t *out_header = NULL;
     axis2_soap_fault_t *soap_fault = NULL;
     axis2_om_node_t *out_node = NULL;
     axis2_status_t status = AXIS2_SUCCESS;
@@ -244,6 +246,13 @@
         return AXIS2_FAILURE;
     }
 
+    out_header = axis2_soap_header_create_with_parent(env, default_envelope);
+    if (!out_header)
+    {
+        return AXIS2_FAILURE;
+    }
+    AXIS2_SOAP_ENVELOPE_SET_HEADER(default_envelope, env, out_header);
+
     out_body = axis2_soap_body_create_with_parent(env, default_envelope);
     if (!out_body)
     {
@@ -255,6 +264,7 @@
     {
         return AXIS2_FAILURE;
     }
+    AXIS2_SOAP_ENVELOPE_SET_BODY(default_envelope, env, out_body);
     
     if (status != 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=377156&r1=377155&r2=377156&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Sun Feb 12 03:20:06 2006
@@ -216,27 +216,35 @@
         axis2_soap_envelope_free(&(envelope_impl->soap_envelope), env);
         return NULL;        
     }
-    
-    envelope_impl->soap_envelope.ops->get_header = 
-        axis2_soap_envelope_get_header;
-  /*  envelope_impl->soap_envelope.ops->add_header = axis2_soap_envelope_add_header; */
-    envelope_impl->soap_envelope.ops->get_body = 
-        axis2_soap_envelope_get_body;
-    envelope_impl->soap_envelope.ops->serialize = 
-        axis2_soap_envelope_serialize;    
+
     envelope_impl->soap_envelope.ops->free = 
-        axis2_soap_envelope_free;
+            axis2_soap_envelope_free;
+    
     envelope_impl->soap_envelope.ops->get_base_node = 
-        axis2_soap_envelope_get_base_node;
+            axis2_soap_envelope_get_base_node;
+    envelope_impl->soap_envelope.ops->set_base_node = 
+            axis2_soap_envelope_set_base_node;
     envelope_impl->soap_envelope.ops->get_soap_version = 
-        axis2_soap_envelope_get_soap_version;
+            axis2_soap_envelope_get_soap_version;
     envelope_impl->soap_envelope.ops->set_soap_version = 
-        axis2_soap_envelope_set_soap_version;
+            axis2_soap_envelope_set_soap_version;
+    envelope_impl->soap_envelope.ops->get_body = 
+            axis2_soap_envelope_get_body;
+    envelope_impl->soap_envelope.ops->set_body = 
+            axis2_soap_envelope_set_body;
+    
+    envelope_impl->soap_envelope.ops->get_header = 
+            axis2_soap_envelope_get_header;
+   /* envelope_impl->soap_envelope.ops->add_header = axis2_soap_envelope_add_header; */
+    envelope_impl->soap_envelope.ops->set_header = 
+            axis2_soap_envelope_set_header;
     envelope_impl->soap_envelope.ops->get_namespace = 
-        axis2_soap_envelope_get_namespace;
+            axis2_soap_envelope_get_namespace;
     envelope_impl->soap_envelope.ops->set_builder =
-        axis2_soap_envelope_set_builder;
-        
+            axis2_soap_envelope_set_builder;                  
+    envelope_impl->soap_envelope.ops->serialize = 
+            axis2_soap_envelope_serialize;    
+    
     return &(envelope_impl->soap_envelope);        
 }
 
@@ -514,7 +522,7 @@
     }
     else
     {
-        AXIS2_LOG_WRITE((*env)->log, " trying to set a soap bedy to envelope when a soap body alrady exists ", AXIS2_LOG_LEVEL_DEBUG);
+        AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, "trying to set a soap bedy to envelope when a soap body alrady exists");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
@@ -533,7 +541,7 @@
     }
     else
     {
-       AXIS2_LOG_WRITE((*env)->log, " trying to set a soap header to envelope when a soap header alrady exists ", AXIS2_LOG_LEVEL_DEBUG);
+       AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, " trying to set a soap header to envelope when a soap header alrady exists");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;

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=377156&r1=377155&r2=377156&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Sun Feb 12 03:20:06 2006
@@ -132,6 +132,7 @@
     header_impl->om_ele_node     = NULL;
     header_impl->hbnumber = 0;
     header_impl->header_blocks = NULL;
+    header_impl->soap_version = AXIS2_SOAP12;
     
     
     header_impl->soap_header.ops = NULL;
@@ -191,7 +192,8 @@
     header = axis2_soap_header_create(env);
     if(!header)
         return NULL;
-    header_impl = AXIS2_INTF_TO_IMPL(header);        
+    header_impl = AXIS2_INTF_TO_IMPL(header);
+    header_impl->soap_version = AXIS2_SOAP_ENVELOPE_GET_SOAP_VERSION(envelope, env);
         
     parent_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(envelope, env);
     parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent_node, env);