You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/08/29 16:19:27 UTC
svn commit: r690268 - in /webservices/sandesha/trunk/c/src:
msgprocessors/close_seq_msg_processor.c util/msg_creator.c wsrm/ack_final.c
wsrm/close_seq.c wsrm/close_seq_res.c
Author: damitha
Date: Fri Aug 29 07:19:26 2008
New Revision: 690268
URL: http://svn.apache.org/viewvc?rev=690268&view=rev
Log:
Working on close sequence support
Modified:
webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
webservices/sandesha/trunk/c/src/util/msg_creator.c
webservices/sandesha/trunk/c/src/wsrm/ack_final.c
webservices/sandesha/trunk/c/src/wsrm/close_seq.c
webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c
Modified: webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c?rev=690268&r1=690267&r2=690268&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c Fri Aug 29 07:19:26 2008
@@ -49,8 +49,7 @@
* @brief Close Sequence Message Processor struct impl
* Sandesha2 Close Sequence Msg Processor
*/
-typedef struct sandesha2_close_seq_msg_processor_impl
- sandesha2_close_seq_msg_processor_impl_t;
+typedef struct sandesha2_close_seq_msg_processor_impl sandesha2_close_seq_msg_processor_impl_t;
struct sandesha2_close_seq_msg_processor_impl
{
@@ -60,34 +59,31 @@
#define SANDESHA2_INTF_TO_IMPL(msg_proc) \
((sandesha2_close_seq_msg_processor_impl_t *)(msg_proc))
-/***************************** Function headers *******************************/
-axis2_status_t AXIS2_CALL
+static axis2_status_t
sandesha2_close_seq_msg_processor_process_in_msg (
- sandesha2_msg_processor_t *msg_processor,
- const axutil_env_t *env,
- sandesha2_msg_ctx_t *rm_msg_ctx);
+ sandesha2_msg_processor_t *msg_processor,
+ const axutil_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
-axis2_status_t AXIS2_CALL
+static axis2_status_t
sandesha2_close_seq_msg_processor_process_out_msg(
- sandesha2_msg_processor_t *msg_processor,
- const axutil_env_t *env,
- sandesha2_msg_ctx_t *rm_msg_ctx);
+ sandesha2_msg_processor_t *msg_processor,
+ const axutil_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
-axis2_status_t AXIS2_CALL
-sandesha2_close_seq_msg_processor_free (sandesha2_msg_processor_t *element,
- const axutil_env_t *env);
-
-/***************************** End of function headers ************************/
+static axis2_status_t
+sandesha2_close_seq_msg_processor_free (
+ sandesha2_msg_processor_t *element,
+ const axutil_env_t *env);
AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
-sandesha2_close_seq_msg_processor_create(const axutil_env_t *env)
+sandesha2_close_seq_msg_processor_create(
+ const axutil_env_t *env)
{
sandesha2_close_seq_msg_processor_impl_t *msg_proc_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
- msg_proc_impl = (sandesha2_close_seq_msg_processor_impl_t *)AXIS2_MALLOC
- (env->allocator,
- sizeof(sandesha2_close_seq_msg_processor_impl_t));
+ msg_proc_impl = (sandesha2_close_seq_msg_processor_impl_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(sandesha2_close_seq_msg_processor_impl_t));
if(!msg_proc_impl)
{
@@ -97,41 +93,47 @@
msg_proc_impl->msg_processor.ops = AXIS2_MALLOC(env->allocator,
sizeof(sandesha2_msg_processor_ops_t));
+
if(!msg_proc_impl->msg_processor.ops)
{
- sandesha2_close_seq_msg_processor_free((sandesha2_msg_processor_t*)
- msg_proc_impl, env);
+ sandesha2_close_seq_msg_processor_free((sandesha2_msg_processor_t*) msg_proc_impl, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
msg_proc_impl->msg_processor.ops->process_in_msg =
sandesha2_close_seq_msg_processor_process_in_msg;
+
msg_proc_impl->msg_processor.ops->process_out_msg =
sandesha2_close_seq_msg_processor_process_out_msg;
+
msg_proc_impl->msg_processor.ops->free = sandesha2_close_seq_msg_processor_free;
return &(msg_proc_impl->msg_processor);
}
-axis2_status_t AXIS2_CALL
-sandesha2_close_seq_msg_processor_free (sandesha2_msg_processor_t *msg_processor,
- const axutil_env_t *env)
+static axis2_status_t
+sandesha2_close_seq_msg_processor_free(
+ sandesha2_msg_processor_t *msg_processor,
+ const axutil_env_t *env)
{
sandesha2_close_seq_msg_processor_impl_t *msg_proc_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
msg_proc_impl = SANDESHA2_INTF_TO_IMPL(msg_processor);
if(msg_processor->ops)
+ {
AXIS2_FREE(env->allocator, msg_processor->ops);
+ }
AXIS2_FREE(env->allocator, SANDESHA2_INTF_TO_IMPL(msg_processor));
+
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+static axis2_status_t
sandesha2_close_seq_msg_processor_process_in_msg (
sandesha2_msg_processor_t *msg_processor,
const axutil_env_t *env,
@@ -166,91 +168,121 @@
seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
+
close_seq = sandesha2_msg_ctx_get_close_seq(rm_msg_ctx, env);
- seq_id = sandesha2_identifier_get_identifier(
- sandesha2_close_seq_get_identifier(close_seq, env), env);
+ seq_id = sandesha2_identifier_get_identifier(sandesha2_close_seq_get_identifier(close_seq, env),
+ env);
- fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_unknown_seq(env,
- rm_msg_ctx, seq_id, seq_prop_mgr, create_seq_mgr, next_msg_mgr);
+ fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_unknown_seq(env, rm_msg_ctx, seq_id,
+ seq_prop_mgr, create_seq_mgr, next_msg_mgr);
+
if(fault_rm_msg_ctx)
{
engine = axis2_engine_create(env, conf_ctx);
+
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]axis2_engine_send");
- axis2_engine_send(engine, env, sandesha2_msg_ctx_get_msg_ctx(
- fault_rm_msg_ctx, env));
+
+ axis2_engine_send(engine, env, sandesha2_msg_ctx_get_msg_ctx(fault_rm_msg_ctx, env));
if(fault_rm_msg_ctx)
+ {
sandesha2_msg_ctx_free(fault_rm_msg_ctx, env);
+ }
+
if(engine)
{
axis2_engine_free(engine, env);
engine = NULL;
}
+
axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
if(seq_prop_mgr)
+ {
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ }
+
if(create_seq_mgr)
+ {
sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+ }
+
if(next_msg_mgr)
+ {
sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+ }
+
return AXIS2_SUCCESS;
}
+
close_seq_bean = sandesha2_seq_property_bean_create(env);
sandesha2_seq_property_bean_set_seq_id(close_seq_bean, env, seq_id);
- sandesha2_seq_property_bean_set_name(close_seq_bean, env,
- SANDESHA2_SEQ_PROP_SEQ_CLOSED);
- sandesha2_seq_property_bean_set_value(close_seq_bean, env,
- AXIS2_VALUE_TRUE);
+ sandesha2_seq_property_bean_set_name(close_seq_bean, env, SANDESHA2_SEQ_PROP_SEQ_CLOSED);
+ sandesha2_seq_property_bean_set_value(close_seq_bean, env, AXIS2_VALUE_TRUE);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, close_seq_bean);
- ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id,
- seq_prop_mgr);
+ ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id, seq_prop_mgr);
ack_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
- rm_ns_val = sandesha2_msg_ctx_get_rm_ns_val(ack_rm_msg, env);
- sandesha2_msg_ctx_get_rm_ns_val(rm_msg_ctx, env);
+ rm_ns_val = sandesha2_msg_ctx_get_rm_ns_val(rm_msg_ctx, env);
sandesha2_msg_ctx_set_rm_ns_val(ack_rm_msg, env, rm_ns_val);
envelope = axiom_soap_envelope_create_default_soap_envelope(env,
- sandesha2_utils_get_soap_version(env,
- axis2_msg_ctx_get_soap_envelope(msg_ctx, env)));
+ sandesha2_utils_get_soap_version(env, axis2_msg_ctx_get_soap_envelope(msg_ctx, env)));
+
axis2_msg_ctx_set_soap_envelope(ack_msg_ctx, env, envelope);
seq_ack = sandesha2_msg_ctx_get_seq_ack(ack_rm_msg, env);
close_seq_res_msg = sandesha2_utils_create_out_msg_ctx(env, msg_ctx);
- close_seq_res_rm_msg = sandesha2_msg_creator_create_close_seq_res_msg(env,
- rm_msg_ctx, close_seq_res_msg, seq_prop_mgr);
+ close_seq_res_rm_msg = sandesha2_msg_creator_create_close_seq_res_msg(env, rm_msg_ctx,
+ close_seq_res_msg, seq_prop_mgr);
sandesha2_msg_ctx_set_seq_ack(close_seq_res_rm_msg, env, seq_ack);
sandesha2_msg_ctx_set_flow(close_seq_res_rm_msg, env, AXIS2_OUT_FLOW);
- property = axutil_property_create_with_args(env, 0, 0, 0,
- AXIS2_VALUE_TRUE);
+ property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
sandesha2_msg_ctx_set_property(close_seq_res_rm_msg, env,
- SANDESHA2_APPLICATION_PROCESSING_DONE, property);
+ SANDESHA2_APPLICATION_PROCESSING_DONE, property);
+
/*AXIS2_MSG_CTX_SET_RESPONSE_WRITTEN(close_seq_res_msg, env, AXIS2_TRUE);*/
sandesha2_msg_ctx_add_soap_envelope(close_seq_res_rm_msg, env);
engine = axis2_engine_create(env, conf_ctx);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]axis2_engine_send");
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] axis2_engine_send");
axis2_engine_send(engine, env, close_seq_res_msg);
+
if(engine)
+ {
axis2_engine_free(engine, env);
+ }
+
if(seq_prop_mgr)
+ {
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ }
+
if(create_seq_mgr)
+ {
sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+ }
+
if(next_msg_mgr)
+ {
sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+ }
+
if(close_seq_res_rm_msg)
+ {
sandesha2_msg_ctx_free(close_seq_res_rm_msg, env);
+ }
+
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+static axis2_status_t
sandesha2_close_seq_msg_processor_process_out_msg(
- sandesha2_msg_processor_t *msg_processor,
- const axutil_env_t *env,
- sandesha2_msg_ctx_t *rm_msg_ctx)
+ sandesha2_msg_processor_t *msg_processor,
+ const axutil_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx)
{
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?rev=690268&r1=690267&r2=690268&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Fri Aug 29 07:19:26 2008
@@ -973,8 +973,7 @@
axis2_bool_t is_allowed = AXIS2_FALSE;
/* sequence is closed. so add the 'Final' part. */
- is_allowed = sandesha2_spec_specific_consts_is_ack_final_allowed(env,
- rm_version);
+ is_allowed = sandesha2_spec_specific_consts_is_ack_final_allowed(env, rm_version);
if(is_allowed)
{
sandesha2_ack_final_t *ack_final = NULL;
Modified: webservices/sandesha/trunk/c/src/wsrm/ack_final.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/ack_final.c?rev=690268&r1=690267&r2=690268&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/ack_final.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/ack_final.c Fri Aug 29 07:19:26 2008
@@ -39,20 +39,20 @@
sandesha2_ack_final_t *ack_final = NULL;
AXIS2_PARAM_CHECK(env->error, ns_val, NULL);
- if(AXIS2_FALSE == sandesha2_ack_final_is_namespace_supported(env, ns_val))
+ if(!sandesha2_ack_final_is_namespace_supported(env, ns_val))
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS, AXIS2_FAILURE);
return NULL;
- }
- ack_final = (sandesha2_ack_final_t *)AXIS2_MALLOC
- (env->allocator, sizeof(sandesha2_ack_final_t));
+ }
+
+ ack_final = (sandesha2_ack_final_t *)AXIS2_MALLOC(env->allocator, sizeof(sandesha2_ack_final_t));
- if(NULL == ack_final)
+ if(!ack_final)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
ack_final->ns_val = NULL;
ack_final->ns_val = (axis2_char_t *)axutil_strdup(env, ns_val);
@@ -65,12 +65,14 @@
sandesha2_ack_final_t *ack_final,
const axutil_env_t *env)
{
- if(NULL != ack_final->ns_val)
+ if(ack_final->ns_val)
{
AXIS2_FREE(env->allocator, ack_final->ns_val);
ack_final->ns_val = NULL;
}
+
AXIS2_FREE(env->allocator, ack_final);
+
return AXIS2_SUCCESS;
}
@@ -96,31 +98,38 @@
AXIS2_PARAM_CHECK(env->error, om_node, NULL);
- final_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_FINAL,
- ack_final->ns_val, NULL);
- if(NULL == final_qname)
+ final_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_FINAL, ack_final->ns_val, NULL);
+ if(!final_qname)
{
return NULL;
}
+
om_element = axiom_node_get_data_element(om_node, env);
- if(NULL == om_element)
+ if(!om_element)
{
if(final_qname)
+ {
axutil_qname_free(final_qname, env);
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ }
+
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
return NULL;
}
- final_part = axiom_element_get_first_child_with_qname(om_element, env,
- final_qname, om_node, &final_part_node);
+
+ final_part = axiom_element_get_first_child_with_qname(om_element, env, final_qname, om_node,
+ &final_part_node);
+
if(final_qname)
+ {
axutil_qname_free(final_qname, env);
- if(NULL == final_part)
+ }
+
+ if(!final_part)
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
return NULL;
}
+
return ack_final;
}
@@ -128,7 +137,8 @@
axiom_node_t* AXIS2_CALL
sandesha2_ack_final_to_om_node(
sandesha2_ack_final_t *ack_final,
- const axutil_env_t *env, void *om_node)
+ const axutil_env_t *env,
+ void *om_node)
{
axiom_namespace_t *rm_ns = NULL;
axiom_element_t *af_element = NULL;
@@ -136,15 +146,15 @@
AXIS2_PARAM_CHECK(env->error, om_node, NULL);
- rm_ns = axiom_namespace_create(env, ack_final->ns_val,
- SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
- if(NULL == rm_ns)
+ rm_ns = axiom_namespace_create(env, ack_final->ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+ if(!rm_ns)
{
return NULL;
}
- af_element = axiom_element_create(env, NULL, SANDESHA2_WSRM_COMMON_FINAL,
- rm_ns, &af_node);
+
+ af_element = axiom_element_create(env, NULL, SANDESHA2_WSRM_COMMON_FINAL, rm_ns, &af_node);
axiom_node_add_child((axiom_node_t*)om_node, env, af_node);
+
return (axiom_node_t*)om_node;
}
@@ -153,13 +163,16 @@
const axutil_env_t *env,
axis2_char_t *namespace)
{
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
{
return AXIS2_FALSE;
}
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
+
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
{
return AXIS2_TRUE;
- }
+ }
+
return AXIS2_FALSE;
}
+
Modified: webservices/sandesha/trunk/c/src/wsrm/close_seq.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/close_seq.c?rev=690268&r1=690267&r2=690268&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/close_seq.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/close_seq.c Fri Aug 29 07:19:26 2008
@@ -41,20 +41,19 @@
sandesha2_close_seq_t *close_seq = NULL;
AXIS2_PARAM_CHECK(env->error, ns_val, NULL);
- if(AXIS2_FALSE == sandesha2_close_seq_is_namespace_supported(
- env, ns_val))
+ if(!sandesha2_close_seq_is_namespace_supported(env, ns_val))
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS, AXIS2_FAILURE);
return NULL;
- }
- close_seq = (sandesha2_close_seq_t *)AXIS2_MALLOC
- (env->allocator, sizeof(sandesha2_close_seq_t));
+ }
+
+ close_seq = (sandesha2_close_seq_t *)AXIS2_MALLOC(env->allocator, sizeof(sandesha2_close_seq_t));
if(!close_seq)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
close_seq->ns_val = NULL;
close_seq->identifier = NULL;
@@ -84,6 +83,7 @@
AXIS2_FREE(env->allocator, close_seq->ns_val);
close_seq->ns_val = NULL;
}
+
close_seq->identifier = NULL;
AXIS2_FREE(env->allocator, close_seq);
return AXIS2_SUCCESS;
@@ -110,21 +110,21 @@
close_seq_part = axiom_node_get_data_element(close_seq_node, env);
if(!close_seq_part)
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
return NULL;
}
- close_seq->identifier = sandesha2_identifier_create(env,
- close_seq->ns_val);
+
+ close_seq->identifier = sandesha2_identifier_create(env, close_seq->ns_val);
if(!close_seq->identifier)
{
return NULL;
}
- if(!sandesha2_identifier_from_om_node(close_seq->identifier, env,
- close_seq_node))
+
+ if(!sandesha2_identifier_from_om_node(close_seq->identifier, env, close_seq_node))
{
return NULL;
}
+
return close_seq;
}
@@ -143,24 +143,25 @@
if(!close_seq->identifier)
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, AXIS2_FAILURE);
return NULL;
}
- rm_ns = axiom_namespace_create(env, close_seq->ns_val,
- SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+
+ rm_ns = axiom_namespace_create(env, close_seq->ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
if(!rm_ns)
{
return NULL;
}
- cs_element = axiom_element_create(env, NULL,
- SANDESHA2_WSRM_COMMON_CLOSE_SEQ, rm_ns, &cs_node);
+
+ cs_element = axiom_element_create(env, NULL, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, rm_ns, &cs_node);
if(!cs_element)
{
return NULL;
}
+
sandesha2_identifier_to_om_node(close_seq->identifier, env, cs_node);
axiom_node_add_child((axiom_node_t*)om_node, env, cs_node);
+
return (axiom_node_t*)om_node;
}
@@ -203,18 +204,22 @@
/**
* Remove if old exists
*/
- close_seq_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ,
- close_seq->ns_val, NULL);
+ close_seq_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, close_seq->ns_val,
+ NULL);
+
if(!close_seq_qname)
{
return AXIS2_FAILURE;
}
+
sandesha2_utils_remove_soap_body_part(env, envelope, close_seq_qname);
- body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(
- envelope, env), env);
+ body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(envelope, env), env);
sandesha2_close_seq_to_om_node(close_seq, env, body_node);
if(close_seq_qname)
+ {
axutil_qname_free(close_seq_qname, env);
+ }
+
return AXIS2_SUCCESS;
}
@@ -223,11 +228,12 @@
const axutil_env_t *env,
axis2_char_t *namespace)
{
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
{
return AXIS2_TRUE;
}
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
+
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
{
return AXIS2_TRUE;
}
Modified: webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c?rev=690268&r1=690267&r2=690268&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c Fri Aug 29 07:19:26 2008
@@ -43,21 +43,21 @@
sandesha2_close_seq_res_t *close_seq_res = NULL;
AXIS2_PARAM_CHECK(env->error, ns_val, NULL);
- if(AXIS2_FALSE == sandesha2_close_seq_res_is_namespace_supported(env,
- ns_val))
+ if(!sandesha2_close_seq_res_is_namespace_supported(env, ns_val))
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS, AXIS2_FAILURE);
return NULL;
- }
- close_seq_res = (sandesha2_close_seq_res_t *)AXIS2_MALLOC
- (env->allocator, sizeof(sandesha2_close_seq_res_t));
+ }
+
+ close_seq_res = (sandesha2_close_seq_res_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(sandesha2_close_seq_res_t));
if(!close_seq_res)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
close_seq_res->ns_val = NULL;
close_seq_res->identifier = NULL;
@@ -87,6 +87,7 @@
AXIS2_FREE(env->allocator, close_seq_res->ns_val);
close_seq_res->ns_val = NULL;
}
+
close_seq_res->identifier = NULL;
AXIS2_FREE(env->allocator, close_seq_res);
return AXIS2_SUCCESS;
@@ -113,21 +114,22 @@
csr_part = axiom_node_get_data_element(csr_node, env);
if(!csr_part)
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
return NULL;
}
- close_seq_res->identifier = sandesha2_identifier_create(env,
- close_seq_res->ns_val);
+
+ close_seq_res->identifier = sandesha2_identifier_create(env, close_seq_res->ns_val);
if(!close_seq_res->identifier)
{
return NULL;
}
+
if(!sandesha2_identifier_from_om_node(close_seq_res->identifier, env,
csr_node))
{
return NULL;
}
+
return close_seq_res;
}
@@ -145,26 +147,29 @@
if(!close_seq_res->identifier)
{
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, AXIS2_FAILURE);
return NULL;
}
- rm_ns = axiom_namespace_create(env, close_seq_res->ns_val,
- SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+
+ rm_ns = axiom_namespace_create(env, close_seq_res->ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
if(!rm_ns)
{
return NULL;
}
- csr_element = axiom_element_create(env, NULL,
- SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE, rm_ns,
+
+ csr_element = axiom_element_create(env, NULL, SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE, rm_ns,
&csr_node);
+
if(!csr_element)
{
return NULL;
}
- sandesha2_close_seq_res_to_om_node((sandesha2_close_seq_res_t *)
- close_seq_res->identifier, env, csr_node);
+
+ sandesha2_close_seq_res_to_om_node((sandesha2_close_seq_res_t *) close_seq_res->identifier, env,
+ csr_node);
+
axiom_node_add_child((axiom_node_t*)om_node, env, csr_node);
+
return (axiom_node_t*)om_node;
}
@@ -187,6 +192,7 @@
sandesha2_identifier_free(close_seq_res->identifier, env);
close_seq_res->identifier = NULL;
}
+
close_seq_res->identifier = identifier;
return AXIS2_SUCCESS;
}
@@ -199,23 +205,28 @@
{
axiom_node_t *body_node = NULL;
axutil_qname_t *close_seq_qname = NULL;
+
AXIS2_PARAM_CHECK(env->error, envelope, AXIS2_FAILURE);
+
/**
* Remove if old exists
*/
- close_seq_qname = axutil_qname_create(env,
- SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE,
+ close_seq_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE,
close_seq_res->ns_val, NULL);
+
if(!close_seq_qname)
{
return AXIS2_FAILURE;
}
+
sandesha2_utils_remove_soap_body_part(env, envelope, close_seq_qname);
- body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(
- envelope, env), env);
+ body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(envelope, env), env);
sandesha2_close_seq_res_to_om_node(close_seq_res, env, body_node);
if(close_seq_qname)
+ {
axutil_qname_free(close_seq_qname, env);
+ }
+
return AXIS2_SUCCESS;
}
@@ -224,14 +235,16 @@
const axutil_env_t *env,
axis2_char_t *namespace)
{
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
{
return AXIS2_TRUE;
}
- if(0 == axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
+
+ if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))
{
return AXIS2_TRUE;
}
+
return AXIS2_FALSE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org