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 na...@apache.org on 2006/03/22 07:40:58 UTC
svn commit: r387758 - in /webservices/axis2/trunk/c/modules:
mod_addr/addr_in_handler.c xml/soap/soap_header.c
Author: nandika
Date: Tue Mar 21 22:40:55 2006
New Revision: 387758
URL: http://svn.apache.org/viewcvs?rev=387758&view=rev
Log:
add_header_block function in soap header modified to use a cloned namespace
Modified:
webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c?rev=387758&r1=387757&r2=387758&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c Tue Mar 21 22:40:55 2006
@@ -388,8 +388,6 @@
text = AXIS2_OM_ELEMENT_GET_TEXT(header_block_ele, env, header_block_node);
AXIS2_MSG_INFO_HEADERS_SET_MESSAGE_ID(msg_info_headers, env, text);
AXIS2_SOAP_HEADER_BLOCK_SET_PRECESSED(header_block, env);
- if(NULL != text)
- AXIS2_FREE((*env)->allocator, text);
}
else if(AXIS2_STRCMP(ele_localname, AXIS2_WSA_ACTION) == 0)
{
@@ -397,8 +395,6 @@
text = AXIS2_OM_ELEMENT_GET_TEXT(header_block_ele, env, header_block_node);
AXIS2_MSG_INFO_HEADERS_SET_ACTION(msg_info_headers, env, text);
AXIS2_SOAP_HEADER_BLOCK_SET_PRECESSED(header_block, env);
- if(NULL != text)
- AXIS2_FREE((*env)->allocator, text);
}
else if(AXIS2_STRCMP(ele_localname, AXIS2_WSA_RELATES_TO) == 0)
{
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=387758&r1=387757&r2=387758&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Tue Mar 21 22:40:55 2006
@@ -289,6 +289,8 @@
axis2_soap_header_impl_t *header_impl = NULL;
axis2_soap_header_block_t *header_block = NULL;
+ axis2_om_namespace_t *cloned_ns = NULL;
+
axis2_om_node_t* header_block_node = NULL;
AXIS2_ENV_CHECK(env, NULL);
@@ -297,7 +299,11 @@
header_impl = AXIS2_INTF_TO_IMPL(header);
- header_block = axis2_soap_header_block_create_with_parent(env, localname, ns, header);
+ cloned_ns = AXIS2_OM_NAMESPACE_CLONE(ns, env);
+ if(!cloned_ns)
+ return NULL;
+
+ header_block = axis2_soap_header_block_create_with_parent(env, localname,cloned_ns, header);
if(!header_block)
return NULL;
@@ -307,7 +313,29 @@
if(header_block_node)
{
+ axis2_om_element_t *hb_ele = NULL;
+ axis2_char_t *uri = NULL;
+ axis2_char_t *prefix = NULL;
+
axis2_om_node_set_build_status(header_block_node, env, AXIS2_TRUE);
+
+ hb_ele = (axis2_om_element_t *)
+ AXIS2_OM_NODE_GET_DATA_ELEMENT(header_block_node, env);
+ if(hb_ele)
+ {
+ axis2_om_namespace_t *dec_ns = NULL;
+ uri = AXIS2_OM_NAMESPACE_GET_URI(cloned_ns, env);
+ prefix = AXIS2_OM_NAMESPACE_GET_PREFIX(cloned_ns, env);
+
+ dec_ns = AXIS2_OM_ELEMENT_FIND_DECLARED_NAMESPACE(hb_ele, env, uri, prefix);
+ if(!dec_ns)
+ {
+ /** this namespace it not in hb_ele list so free it */
+ AXIS2_OM_NAMESPACE_FREE(cloned_ns, env);
+ cloned_ns = NULL;
+ }
+
+ }
return header_block;
}
else