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/25 09:37:06 UTC
svn commit: r688639 - in
/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008:
include/ samples/rm_echo_single_1_1/ src/handlers/ src/msgprocessors/
src/polling/ src/storage/sqlite/ src/util/
Author: damitha
Date: Mon Aug 25 00:37:04 2008
New Revision: 688639
URL: http://svn.apache.org/viewvc?rev=688639&view=rev
Log:
RM 1.1 replay mode is implemented.
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_msg_creator.h
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_polling_mgr.h
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_res_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/make_connection_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_res_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/polling/polling_mgr.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h Mon Aug 25 00:37:04 2008
@@ -294,6 +294,8 @@
#define SANDESHA2_SEQ_PROP_1_0_REPLAY "Replay1_0"
#define SANDESHA2_SEQ_PROP_RELATED_MSG_ID "related_msg_id"
+
+ #define SANDESHA2_SEQ_PROP_MAKE_CONNECTION_OUT_PATH "make_connection_out_path"
/**
* SOAP Versions
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_msg_creator.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_msg_creator.h?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_msg_creator.h (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_msg_creator.h Mon Aug 25 00:37:04 2008
@@ -123,6 +123,7 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *ref_rm_msg_ctx,
axis2_char_t *make_conn_seq_id,
+ const axis2_char_t *internal_seq_id,
axis2_char_t *make_conn_anon_uri,
sandesha2_seq_property_mgr_t *seq_prop_mgr);
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_polling_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_polling_mgr.h?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_polling_mgr.h (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_polling_mgr.h Mon Aug 25 00:37:04 2008
@@ -32,6 +32,8 @@
#include <axutil_utils.h>
#include <axis2_conf_ctx.h>
#include <sandesha2_msg_ctx.h>
+#include <sandesha2_storage_mgr.h>
+#include <sandesha2_sender_mgr.h>
#ifdef __cplusplus
extern "C"
@@ -43,6 +45,8 @@
sandesha2_polling_mgr_start (
const axutil_env_t *env,
axis2_conf_ctx_t *conf_ctx,
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_sender_mgr_t *sender_mgr,
sandesha2_msg_ctx_t *rm_msg_ctx,
const axis2_char_t *internal_sequence_id,
axis2_char_t *sequence_id,
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c Mon Aug 25 00:37:04 2008
@@ -30,7 +30,7 @@
#include <axis2_addr.h>
#include <ctype.h>
-#define SANDESHA2_SLEEP 12
+#define SANDESHA2_SLEEP 4
static void
usage(
@@ -49,9 +49,10 @@
axutil_property_t *property = NULL;
axis2_listener_manager_t *listener_manager = NULL;
axis2_char_t *offered_seq_id = NULL;
- axis2_status_t status = AXIS2_FAILURE;
axis2_char_t *seq_key = NULL;
int c;
+ /*axis2_status_t status = AXIS2_FAILURE;*/
+ axiom_node_t *result = NULL;
/* Set up the environment */
env = axutil_env_create_all("rm_echo_single_1_1.log", AXIS2_LOG_LEVEL_TRACE);
@@ -166,34 +167,86 @@
}
payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
- status = axis2_svc_client_send_robust(svc_client, env, payload);
+ /*status = axis2_svc_client_send_robust(svc_client, env, payload);
if(status)
{
printf("\necho client single channel invoke SUCCESSFUL!\n");
}
- payload = NULL;
+ payload = NULL;*/
+ result = axis2_svc_client_send_receive(svc_client, env, payload);
+ if(result)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(result, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+ result = NULL;
+ }
+ else
+ {
+ printf("\necho client two way single channel invoke FAILED!\n");
+ }
payload = build_om_payload_for_echo_svc(env, "echo2", seq_key);
- status = axis2_svc_client_send_robust(svc_client, env, payload);
+ /*status = axis2_svc_client_send_robust(svc_client, env, payload);
if(status)
{
printf("\necho client single channel invoke SUCCESSFUL!\n");
}
- payload = NULL;
+ payload = NULL;*/
+ result = axis2_svc_client_send_receive(svc_client, env, payload);
+ if(result)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(result, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+ result = NULL;
+ }
+ else
+ {
+ printf("\necho client two way single channel invoke FAILED!\n");
+ }
payload = build_om_payload_for_echo_svc(env, "echo3", seq_key);
- status = axis2_svc_client_send_robust(svc_client, env, payload);
+ /*status = axis2_svc_client_send_robust(svc_client, env, payload);
if(status)
{
printf("\necho client single channel invoke SUCCESSFUL!\n");
}
- payload = NULL;
+ payload = NULL;*/
+
+ result = axis2_svc_client_send_receive(svc_client, env, payload);
+ if(result)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(result, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+ result = NULL;
+ }
+ else
+ {
+ printf("\necho client two way single channel invoke FAILED!\n");
+ }
AXIS2_SLEEP(SANDESHA2_SLEEP);
sandesha2_client_terminate_seq_with_svc_client_and_seq_key(env, svc_client, seq_key);
- AXIS2_SLEEP(SANDESHA2_SLEEP);
+ AXIS2_SLEEP(6 * SANDESHA2_SLEEP);
if (svc_client)
{
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c Mon Aug 25 00:37:04 2008
@@ -81,6 +81,16 @@
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2] Entry:sandesha2_out_handler_invoke");
+
+ temp_prop = axis2_msg_ctx_get_property(msg_ctx, env, SANDESHA2_SEQ_PROP_MAKE_CONNECTION_OUT_PATH);
+ if (temp_prop)
+ {
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "[sandesha2] In make connection out path. So return here.");
+ return AXIS2_SUCCESS;
+ temp_prop = NULL;
+ }
+
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if(!conf_ctx)
{
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c Mon Aug 25 00:37:04 2008
@@ -1809,8 +1809,9 @@
}
is_anonymous_reply_to = !reply_to_addr || (reply_to_addr && sandesha2_utils_is_anon_uri(env, reply_to_addr));
- if(sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, acks_to_str)
- && is_anonymous_reply_to && !one_way)
+ /*if(sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, acks_to_str)
+ && is_anonymous_reply_to && !one_way)*/
+ if(sandesha2_utils_is_anon_uri(env, acks_to_str) && is_anonymous_reply_to && !one_way)
{
/* This means acknowledgment address is anomymous and RM version is 1.0. Flow comes to
* this block only in the server side.
@@ -2396,11 +2397,14 @@
axis2_bool_t is_server_side = AXIS2_FALSE;
sandesha2_sender_bean_t *create_sequence_sender_bean = NULL;
axis2_char_t *msg_id = NULL;
- sandesha2_seq_property_bean_t *rms_sequence_bean = NULL;
+ /*sandesha2_seq_property_bean_t *rms_sequence_bean = NULL;*/
axis2_bool_t continue_sending = AXIS2_TRUE;
axis2_transport_out_desc_t *transport_out = NULL;
axis2_transport_sender_t *transport_sender = NULL;
axis2_op_t *create_seq_op = NULL;
+ axis2_msg_ctx_t *create_seq_msg_ctx = NULL;
+ sandesha2_sender_bean_t *find_sender_bean = NULL;
+ sandesha2_sender_bean_t *sender_bean = NULL;
args = (sandesha2_app_msg_processor_args_t*) data;
env = args->env;
@@ -2415,7 +2419,7 @@
is_server_side = args->is_server_side;
retrans_interval = args->retrans_interval;
create_sequence_sender_bean = (sandesha2_sender_bean_t *) args->bean;
- axis2_msg_ctx_t *create_seq_msg_ctx = (axis2_msg_ctx_t *) args->msg_ctx;
+ create_seq_msg_ctx = (axis2_msg_ctx_t *) args->msg_ctx;
dbname = sandesha2_util_get_dbname(env, conf_ctx);
storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
@@ -2427,16 +2431,32 @@
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dam_internal_sequence_id:%s", internal_sequence_id);
- rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_sequence_id,
- SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);
+ find_sender_bean = sandesha2_sender_bean_create(env);
+ sandesha2_sender_bean_set_msg_type(find_sender_bean, env, SANDESHA2_MSG_TYPE_CREATE_SEQ);
+ sandesha2_sender_bean_set_internal_seq_id(find_sender_bean, env, internal_sequence_id);
+ sandesha2_sender_bean_set_send(find_sender_bean, env, AXIS2_TRUE);
+
+ sender_bean = sandesha2_sender_mgr_find_unique(sender_mgr, env, find_sender_bean);
+
+ /*rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_sequence_id,
+ SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);*/
create_seq_op = axis2_msg_ctx_get_op(create_seq_msg_ctx, env);
transport_out = axis2_msg_ctx_get_transport_out_desc(create_seq_msg_ctx, env);
transport_sender = axis2_transport_out_desc_get_sender(transport_out, env);
- while(!rms_sequence_bean)
+ while(sender_bean)
{
+ if(sender_bean)
+ {
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "sender bean found");
+ sandesha2_sender_bean_free(sender_bean, env);
+ sender_bean = NULL;
+ }
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "rms_sequence_bean is NULL");
+
continue_sending = sandesha2_msg_retrans_adjuster_adjust_retrans(env, create_sequence_sender_bean,
conf_ctx, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
@@ -2472,13 +2492,19 @@
}
}*/
- rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_sequence_id,
- SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);
+ sender_bean = sandesha2_sender_mgr_find_unique(sender_mgr, env, find_sender_bean);
+ /*rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_sequence_id,
+ SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);*/
}
- if(rms_sequence_bean)
+ /*if(rms_sequence_bean)
{
sandesha2_seq_property_bean_free(rms_sequence_bean, env);
+ }*/
+
+ if(find_sender_bean)
+ {
+ sandesha2_sender_bean_free(find_sender_bean, env);
}
if(create_seq_msg_ctx)
@@ -2928,10 +2954,12 @@
* If server side and anonymous acknowledgment in RM 1.0. In other words this is RM 1.0 replay mode.
* Note that in this case to_addr is NULL. In duplex mode to_addr cannot be NULL.
* */
- if(is_svr_side && sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, from_acks_to_addr)
- && !to_addr)
+ /*if(is_svr_side && sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, from_acks_to_addr)
+ && !to_addr)*/
+
+ if(is_svr_side && sandesha2_utils_is_anon_uri(env, from_acks_to_addr) && (!to_addr ||
+ sandesha2_utils_is_anon_uri(env, to_addr)))
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came1");
sandesha2_msg_creator_add_ack_msg(env, rm_msg_ctx, rmd_sequence_id, seq_prop_mgr);
if(req_rm_msg_ctx)
{
@@ -3073,7 +3101,6 @@
if(!is_svr_side && (!reply_to_addr || sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, reply_to_addr)))
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came2");
axis2_transport_out_desc_t *transport_out = NULL;
axis2_transport_sender_t *transport_sender = NULL;
sandesha2_sender_bean_t *sender_bean = NULL;
@@ -3210,7 +3237,6 @@
sandesha2_seq_property_bean_free(relates_to_bean, env);
}
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came3");
axis2_msg_ctx_increment_ref(app_msg_ctx, env);
engine = axis2_engine_create(env, conf_ctx);
if(axis2_engine_resume_send(engine, env, app_msg_ctx))
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_res_msg_processor.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_res_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_res_msg_processor.c Mon Aug 25 00:37:04 2008
@@ -290,6 +290,24 @@
SANDESHA2_SEQUENCE_PROPERTY_RMS_INTERNAL_SEQ_ID, internal_sequence_id);
if(rms_internal_sequence_bean)
{
+ sandesha2_sender_bean_t *find_sender_bean = NULL;
+ sandesha2_sender_bean_t *sender_bean = NULL;
+
+ find_sender_bean = sandesha2_sender_bean_create(env);
+ sandesha2_sender_bean_set_msg_type(find_sender_bean, env, SANDESHA2_MSG_TYPE_CREATE_SEQ);
+ sandesha2_sender_bean_set_internal_seq_id(find_sender_bean, env, internal_sequence_id);
+ sandesha2_sender_bean_set_send(find_sender_bean, env, AXIS2_TRUE);
+
+ sender_bean = sandesha2_sender_mgr_find_unique(sender_mgr, env, find_sender_bean);
+ if(sender_bean)
+ {
+ axis2_char_t *msg_id = NULL;
+
+ msg_id = sandesha2_sender_bean_get_msg_id(sender_bean, env);
+ sandesha2_sender_mgr_remove(sender_mgr, env, msg_id);
+ sandesha2_sender_bean_free(sender_bean, env);
+ }
+
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, rms_internal_sequence_bean);
sandesha2_seq_property_bean_free(rms_internal_sequence_bean, env);
}
@@ -539,8 +557,8 @@
/* If polling_mode is true, starting the polling manager */
if(polling_mode)
{
- /*sandesha2_polling_mgr_start(env, conf_ctx, create_seq_rm_msg, internal_sequence_id,
- rmd_sequence_id, reply_to_addr);*/
+ sandesha2_polling_mgr_start(env, conf_ctx, storage_mgr, sender_mgr, create_seq_rm_msg,
+ internal_sequence_id, rmd_sequence_id, reply_to_addr);
}
sandesha2_next_msg_mgr_insert(next_msg_mgr, env, next_bean);
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/make_connection_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/make_connection_msg_processor.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/make_connection_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/make_connection_msg_processor.c Mon Aug 25 00:37:04 2008
@@ -251,6 +251,8 @@
sandesha2_seq_property_bean_t *int_seq_bean = NULL;
axutil_array_list_t *msgs_not_to_send = NULL;
axis2_char_t *dbname = NULL;
+ /*const axis2_char_t *wsa_action = NULL;
+ axutil_string_t *soap_action = NULL;*/
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:sandesha2_make_connection_msg_processor_process_in_msg");
@@ -271,7 +273,11 @@
seq_id = sandesha2_identifier_get_identifier(identifier, env);
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
if(msg_ctx)
+ {
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
+ }
+
if(conf_ctx)
dbname = sandesha2_util_get_dbname(env, conf_ctx);
storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
@@ -321,6 +327,7 @@
}
msg_storage_key = sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean,
env);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dam_msg_storage_key:%s", msg_storage_key);
return_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
msg_storage_key, conf_ctx, AXIS2_TRUE);
if(!return_msg_ctx)
@@ -337,6 +344,15 @@
sandesha2_storage_mgr_free(storage_mgr, env);
return AXIS2_FAILURE;
}
+
+ /*wsa_action = axis2_msg_ctx_get_wsa_action(return_msg_ctx, env);
+ soap_action = axutil_string_create(env, wsa_action);
+ if(soap_action)
+ {
+ axis2_msg_ctx_set_soap_action(return_msg_ctx, env, soap_action);
+ axutil_string_free(soap_action, env);
+ }*/
+
return_rm_msg_ctx = sandesha2_msg_init_init_msg(env, return_msg_ctx);
add_msg_pending_header(env, return_rm_msg_ctx, pending);
set_transport_properties(env, return_msg_ctx, rm_msg_ctx);
@@ -507,7 +523,6 @@
if(int_seq_id)
AXIS2_FREE(env->allocator, int_seq_id);
}
- 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)
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c Mon Aug 25 00:37:04 2008
@@ -514,6 +514,12 @@
SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID, seq_prop_mgr);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]out_seq_id:%s", out_seq_id);
+ if(rec_side_int_seq_id)
+ {
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] rec_side_int_seq_id:%s", rec_side_int_seq_id);
+ }
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] highest_out_msg_num:%d", highest_out_msg_num);
if(add_rec_side_term && highest_out_msg_num > 0 && rec_side_int_seq_id && out_seq_id)
{
@@ -521,12 +527,15 @@
all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, highest_out_msg_num,
rec_side_int_seq_id, seq_prop_mgr);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] all_acked:%d", all_acked);
if(!all_acked)
{
all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, highest_out_msg_num, out_seq_id,
seq_prop_mgr);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] all_acked:%d", all_acked);
}
- else
+
+ if(all_acked)
{
sandesha2_terminate_mgr_send_terminate_seq_msg(env, rm_msg_ctx, out_seq_id,
rec_side_int_seq_id, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
@@ -920,9 +929,9 @@
sandesha2_seq_property_bean_set_value(term_added, env, AXIS2_VALUE_TRUE);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, term_added);
- sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, int_seq_id,
+ /*sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, int_seq_id,
axis2_msg_ctx_get_server_side(msg_ctx, env), storage_mgr, seq_prop_mgr, create_seq_mgr,
- sender_mgr);
+ sender_mgr);*/
if(seq_prop_mgr)
{
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_res_msg_processor.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_res_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_res_msg_processor.c Mon Aug 25 00:37:04 2008
@@ -169,8 +169,8 @@
/* We need to pass here internal seq id isn't it?:damitha
int internal_seq_id = sandesha2_utils_get_seq_property(env, seq_id,
SANDESHA2_SEQUENCE_PROPERTY_RMS_INTERNAL_SEQ_ID, storage_mgr);*/
- sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, seq_id,
- AXIS2_FALSE, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
+ /*sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, seq_id,
+ AXIS2_FALSE, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);*/
sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/polling/polling_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/polling/polling_mgr.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/polling/polling_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/polling/polling_mgr.c Mon Aug 25 00:37:04 2008
@@ -37,6 +37,7 @@
#include <stdio.h>
#include <platforms/axutil_platform_auto_sense.h>
#include <axutil_types.h>
+#include <axiom_soap_const.h>
/**
@@ -54,6 +55,12 @@
axis2_char_t *sequence_id;
};
+static axis2_status_t AXIS2_CALL
+sandesha2_polling_mgr_process_make_connection_msg_response(
+ const axutil_env_t *env,
+ axis2_msg_ctx_t *msg_ctx,
+ sandesha2_storage_mgr_t *storage_mgr);
+
/**
* Thread worker function.
*/
@@ -66,6 +73,8 @@
sandesha2_polling_mgr_start (
const axutil_env_t *env,
axis2_conf_ctx_t *conf_ctx,
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_sender_mgr_t *sender_mgr,
sandesha2_msg_ctx_t *rm_msg_ctx,
const axis2_char_t *internal_sequence_id,
axis2_char_t *sequence_id,
@@ -75,6 +84,13 @@
sandesha2_polling_mgr_args_t *args = NULL;
axis2_char_t *wsrm_anon_reply_to_uri = NULL;
sandesha2_msg_ctx_t *make_conn_rm_msg_ctx = NULL;
+ axis2_char_t *make_conn_msg_store_key = NULL;
+ axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
+ sandesha2_sender_bean_t *make_conn_sender_bean = NULL;
+ axis2_status_t status = AXIS2_SUCCESS;
+ axis2_engine_t *engine = NULL;
+ axiom_soap_envelope_t *res_envelope = NULL;
+ axutil_property_t *property = NULL;
args = AXIS2_MALLOC(env->allocator, sizeof(sandesha2_polling_mgr_args_t));
args->env = axutil_init_thread_env(env);
@@ -88,10 +104,100 @@
}
make_conn_rm_msg_ctx = sandesha2_msg_creator_create_make_connection_msg(env, rm_msg_ctx,
- sequence_id, wsrm_anon_reply_to_uri, NULL);
+ sequence_id, internal_sequence_id, wsrm_anon_reply_to_uri, NULL);
args->rm_msg_ctx = make_conn_rm_msg_ctx;
+ make_conn_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(make_conn_rm_msg_ctx, env);
+
+ property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(make_conn_msg_ctx, env, SANDESHA2_SEQ_PROP_MAKE_CONNECTION_OUT_PATH,
+ property);
+
+ make_conn_sender_bean = sandesha2_sender_bean_create(env);
+ if(make_conn_sender_bean)
+ {
+ axis2_char_t *msg_id = NULL;
+ long millisecs = 0;
+ axis2_endpoint_ref_t *to = NULL;
+
+ millisecs = sandesha2_utils_get_current_time_in_millis(env);
+ sandesha2_sender_bean_set_time_to_send(make_conn_sender_bean, env, millisecs);
+ make_conn_msg_store_key = axutil_uuid_gen(env);
+ sandesha2_sender_bean_set_msg_ctx_ref_key(make_conn_sender_bean, env,
+ make_conn_msg_store_key);
+ msg_id = sandesha2_msg_ctx_get_msg_id(make_conn_rm_msg_ctx, env);
+ sandesha2_sender_bean_set_msg_id(make_conn_sender_bean, env, msg_id);
+ sandesha2_sender_bean_set_msg_type(make_conn_sender_bean, env,
+ SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
+ sandesha2_sender_bean_set_resend(make_conn_sender_bean, env, AXIS2_FALSE);
+ sandesha2_sender_bean_set_send(make_conn_sender_bean, env, AXIS2_TRUE);
+ sandesha2_sender_bean_set_internal_seq_id(make_conn_sender_bean, env,
+ (axis2_char_t *) internal_sequence_id);
+
+ to = sandesha2_msg_ctx_get_to(make_conn_rm_msg_ctx, env);
+ if(to)
+ {
+ axis2_char_t *address = NULL;
+
+ address = (axis2_char_t *) axis2_endpoint_ref_get_address(
+ (const axis2_endpoint_ref_t *) to, env);
+ sandesha2_sender_bean_set_to_address(make_conn_sender_bean, env, address);
+ }
+ }
+ else
+ {
+ return AXIS2_FAILURE;
+ }
+
+ if(sender_mgr)
+ {
+ sandesha2_sender_mgr_insert(sender_mgr, env, make_conn_sender_bean);
+ sandesha2_sender_bean_free(make_conn_sender_bean, env);
+ }
+
+ engine = axis2_engine_create(env, conf_ctx);
+ status = axis2_engine_send(engine, env, make_conn_msg_ctx);
+ if(engine)
+ {
+ axis2_engine_free(engine, env);
+ }
+
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, make_conn_msg_store_key, make_conn_msg_ctx,
+ AXIS2_TRUE);
+
+ res_envelope = axis2_msg_ctx_get_response_soap_envelope(make_conn_msg_ctx, env);
+
+ if(!res_envelope)
+ {
+ axis2_char_t *soap_ns_uri = NULL;
+
+ soap_ns_uri = axis2_msg_ctx_get_is_soap_11(make_conn_msg_ctx, env) ?
+ AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI:
+ AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Response envelope not found");
+
+ res_envelope = (axiom_soap_envelope_t *) axis2_http_transport_utils_create_soap_msg(env,
+ make_conn_msg_ctx, soap_ns_uri);
+ }
+
+ if(res_envelope)
+ {
+ axis2_msg_ctx_set_response_soap_envelope(make_conn_msg_ctx, env, res_envelope);
+ status = sandesha2_polling_mgr_process_make_connection_msg_response(env, make_conn_msg_ctx,
+ storage_mgr);
+
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Make connection message response process failed for sequence %s",
+ internal_sequence_id);
+
+ return AXIS2_FAILURE;
+ }
+ }
+
worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
sandesha2_polling_mgr_worker_func, (void*)args);
@@ -124,17 +230,18 @@
sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_sender_mgr_t *sender_mgr = NULL;
sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
- axis2_engine_t *engine = NULL;
axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
sandesha2_property_bean_t *property_bean = NULL;
axis2_conf_t *conf = NULL;
int wait_time = 0;
- sandesha2_msg_ctx_t *make_conn_rm_msg_ctx = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ sandesha2_sender_bean_t *find_sender_bean = NULL;
+ sandesha2_sender_bean_t *sender_bean = NULL;
+ axis2_char_t *key = NULL;
sandesha2_polling_mgr_args_t *args = (sandesha2_polling_mgr_args_t*)data;
axutil_env_t *env = args->env;
conf_ctx = args->conf_ctx;
- make_conn_rm_msg_ctx = args->rm_msg_ctx;
internal_sequence_id = axutil_strdup(env, args->internal_sequence_id);
sequence_id = axutil_strdup(env, args->sequence_id);
@@ -146,104 +253,98 @@
seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
- engine = axis2_engine_create(env, conf_ctx);
- make_conn_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(make_conn_rm_msg_ctx, env);
-
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
property_bean = sandesha2_utils_get_property_bean(env, conf);
wait_time = sandesha2_property_bean_get_polling_delay(property_bean, env);
+ find_sender_bean = sandesha2_sender_bean_create(env);
+ sandesha2_sender_bean_set_msg_type(find_sender_bean, env, SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
+ sandesha2_sender_bean_set_internal_seq_id(find_sender_bean, env, internal_sequence_id);
+ sandesha2_sender_bean_set_send(find_sender_bean, env, AXIS2_TRUE);
+
+ sender_bean = sandesha2_sender_mgr_find_unique(sender_mgr, env, find_sender_bean);
+ if(find_sender_bean)
+ {
+ sandesha2_sender_bean_free(find_sender_bean, env);
+ }
+ if(sender_bean)
+ {
+ key = sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean, env);
+ }
+
while(AXIS2_TRUE)
{
- axis2_char_t *make_conn_msg_store_key = NULL;
+ axiom_soap_envelope_t *res_envelope = NULL;
+ axis2_char_t *soap_ns_uri = NULL;
axutil_property_t *property = NULL;
- axis2_status_t status = AXIS2_FAILURE;
+
+ axis2_transport_out_desc_t *transport_out = NULL;
+ axis2_transport_sender_t *transport_sender = NULL;
+ axis2_bool_t successfully_sent = AXIS2_FALSE;
AXIS2_SLEEP(wait_time);
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env, AXIS2_TRANSPORT_IN, NULL);
- make_conn_msg_store_key = axutil_uuid_gen(env);
- property = axutil_property_create_with_args(env, 0, 0, 0, sequence_id);
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
- SANDESHA2_MSG_CTX_PROP_SEQUENCE_PROPERTY_KEY, property);
-
- /*sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, make_conn_msg_store_key,
- make_conn_msg_ctx, AXIS2_TRUE);*/
-
- /* Adde an entry for the MakeConnection message to the sender(with,
- * send=true, resend=false)
- */
- /*make_conn_sender_bean = sandesha2_sender_bean_create(env);
- if(make_conn_sender_bean)
- {
- long millisecs = 0;
-
- millisecs = sandesha2_utils_get_current_time_in_millis(env);
- sandesha2_sender_bean_set_time_to_send(make_conn_sender_bean, env, millisecs);
- sandesha2_sender_bean_set_msg_ctx_ref_key(make_conn_sender_bean, env,
- make_conn_msg_store_key);
-
- msg_id = sandesha2_msg_ctx_get_msg_id(make_conn_rm_msg_ctx, env);
- sandesha2_sender_bean_set_msg_id(make_conn_sender_bean, env, msg_id);
- sandesha2_sender_bean_set_msg_type(make_conn_sender_bean, env,
- SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
-
- sandesha2_sender_bean_set_resend(make_conn_sender_bean, env, AXIS2_FALSE);
- sandesha2_sender_bean_set_send(make_conn_sender_bean, env, AXIS2_TRUE);
- //sandesha2_sender_bean_set_seq_id(make_conn_sender_bean, env, seq_id);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]seq_id:%s", seq_id);
- sandesha2_sender_bean_set_internal_seq_id(make_conn_sender_bean, env, seq_id);
- to = sandesha2_msg_ctx_get_to(make_conn_rm_msg_ctx, env);
- if(to)
- {
- axis2_char_t *address = (axis2_char_t *) axis2_endpoint_ref_get_address(
- (const axis2_endpoint_ref_t *) to, env);
- sandesha2_sender_bean_set_to_address(make_conn_sender_bean, env, address);
- }
- }*/
+ make_conn_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env, key, conf_ctx,
+ AXIS2_TRUE);
- /* This message should not be sent untils it is qualified. i.e. Till
- * it is sent through the sandesha2_transport_sender
- */
- /*property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_FALSE);
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env, SANDESHA2_QUALIFIED_FOR_SENDING,
+ property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(make_conn_msg_ctx, env, SANDESHA2_SEQ_PROP_MAKE_CONNECTION_OUT_PATH,
property);
- if(sender_mgr)
- {
- sandesha2_sender_mgr_insert(sender_mgr, env, make_conn_sender_bean);
- }*/
+ soap_ns_uri = axis2_msg_ctx_get_is_soap_11(make_conn_msg_ctx, env) ?
+ AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI:
+ AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2] Sending the make connection message for the sequence with internal "\
"sequence id %s", internal_sequence_id);
- /*status = sandesha2_utils_execute_and_store(env, make_conn_rm_msg_ctx,
- make_conn_msg_store_key);*/
+ transport_out = axis2_msg_ctx_get_transport_out_desc(make_conn_msg_ctx, env);
+ if(transport_out)
+ {
+ transport_sender = axis2_transport_out_desc_get_sender(transport_out, env);
+ }
+ if(transport_sender)
+ {
+ /* This is neccessary to avoid a double free at http_sender.c */
+ axis2_msg_ctx_set_property(make_conn_msg_ctx, env, AXIS2_TRANSPORT_IN, NULL);
+ if(AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, make_conn_msg_ctx))
+ {
+ successfully_sent = AXIS2_TRUE;
+ }else
+ {
+ successfully_sent = AXIS2_FALSE;
+ }
+ }
- status = axis2_engine_send(engine, env, make_conn_msg_ctx);
+ if(successfully_sent)
+ {
+ res_envelope = axis2_msg_ctx_get_response_soap_envelope(make_conn_msg_ctx, env);
+ }
- if(AXIS2_SUCCESS != status)
+ if(!res_envelope)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]make_connection sending failed");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Response envelope not found");
- if(seq_prop_mgr)
- {
- sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
- }
+ res_envelope = (axiom_soap_envelope_t *) axis2_http_transport_utils_create_soap_msg(env,
+ make_conn_msg_ctx, soap_ns_uri);
+ }
+
+ if(res_envelope)
+ {
+ axis2_msg_ctx_set_response_soap_envelope(make_conn_msg_ctx, env, res_envelope);
+ status = sandesha2_polling_mgr_process_make_connection_msg_response(env, make_conn_msg_ctx,
+ storage_mgr);
- if(sender_mgr)
+ if(AXIS2_SUCCESS != status)
{
- sandesha2_sender_mgr_free(sender_mgr, env);
- }
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Make connection message response process failed for sequence %s",
+ internal_sequence_id);
- if(next_msg_mgr)
- {
- sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+ break;
}
-
- return NULL;
}
}
@@ -267,3 +368,90 @@
return NULL;
}
+static axis2_status_t AXIS2_CALL
+sandesha2_polling_mgr_process_make_connection_msg_response(
+ const axutil_env_t *env,
+ axis2_msg_ctx_t *msg_ctx,
+ sandesha2_storage_mgr_t *storage_mgr)
+{
+ axis2_char_t *soap_ns_uri = NULL;
+ axis2_msg_ctx_t *response_msg_ctx = NULL;
+ axiom_soap_envelope_t *response_envelope = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_engine_t *engine = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ axis2_endpoint_ref_t *to = NULL;
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Entry:sandesha2_polling_mgr_process_make_connection_msg_response");
+
+ AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
+
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+
+ soap_ns_uri = axis2_msg_ctx_get_is_soap_11(msg_ctx, env) ?
+ AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI:
+ AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
+
+ response_envelope = axis2_msg_ctx_get_response_soap_envelope(msg_ctx, env);
+ if(!response_envelope)
+ {
+ response_envelope = (axiom_soap_envelope_t *) axis2_http_transport_utils_create_soap_msg(env,
+ msg_ctx, soap_ns_uri);
+ if(!response_envelope)
+ {
+ /* There is no response message context. */
+
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Response envelope not found");
+
+ return AXIS2_SUCCESS;
+ }
+ }
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Response envelope for make connection message found");
+
+ response_msg_ctx = axis2_msg_ctx_create(env, conf_ctx, axis2_msg_ctx_get_transport_in_desc(msg_ctx,
+ env), axis2_msg_ctx_get_transport_out_desc(msg_ctx, env));
+
+ to = axis2_endpoint_ref_create(env,
+ "http://localhost/axis2/services/__ANONYMOUS_SERVICE__/__OPERATION_OUT_IN__");
+ axis2_msg_ctx_set_to(response_msg_ctx, env, to);
+
+ axis2_msg_ctx_set_wsa_action(response_msg_ctx, env,
+ "http://localhost/axis2/services/__ANONYMOUS_SERVICE__/__OPERATION_OUT_IN__");
+
+ axis2_msg_ctx_set_soap_envelope(response_msg_ctx, env, response_envelope);
+
+ /*axis2_msg_ctx_set_server_side(response_msg_ctx, env, AXIS2_TRUE);*/
+
+ axis2_msg_ctx_set_op_ctx(response_msg_ctx, env, axis2_msg_ctx_get_op_ctx(msg_ctx, env));
+ axis2_msg_ctx_set_svc_ctx(response_msg_ctx, env, axis2_msg_ctx_get_svc_ctx(msg_ctx, env));
+ axis2_msg_ctx_set_svc_grp_ctx(response_msg_ctx, env, axis2_msg_ctx_get_svc_grp_ctx(msg_ctx, env));
+ axis2_msg_ctx_set_conf_ctx(response_msg_ctx, env, conf_ctx);
+
+
+ engine = axis2_engine_create(env, conf_ctx);
+ if(engine)
+ {
+ if(sandesha2_util_is_fault_envelope(env, response_envelope))
+ {
+ status = axis2_engine_receive_fault(engine, env, response_msg_ctx);
+ }
+ else
+ {
+ status = axis2_engine_receive(engine, env, response_msg_ctx);
+ }
+ axis2_engine_free(engine, env);
+ }
+
+ axis2_msg_ctx_set_paused(response_msg_ctx, env, AXIS2_FALSE);
+ axis2_msg_ctx_free(response_msg_ctx, env);
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Exit:sandesha2_polling_mgr_process_make_connection_msg_response");
+
+ return AXIS2_SUCCESS;
+}
+
+
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c Mon Aug 25 00:37:04 2008
@@ -415,13 +415,12 @@
storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Message context retrieved from database");
-
msg_store_bean = sandesha2_permanent_bean_mgr_retrieve_msg_store_bean(storage_mgr_impl->bean_mgr,
env, key);
if (!msg_store_bean)
{
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Message store bean is NULL");
return NULL;
}
@@ -468,10 +467,12 @@
axis2_msg_ctx_set_msg_id(msg_ctx, env, sandesha2_msg_store_bean_get_msg_id(msg_store_bean, env));
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
- transport_out = sandesha2_msg_store_bean_get_transport_out(msg_store_bean,
- env);
+ transport_out = sandesha2_msg_store_bean_get_transport_out(msg_store_bean, env);
transport_out_desc = axis2_conf_get_transport_out(conf, env, transport_out);
- axis2_msg_ctx_set_transport_out_desc(msg_ctx, env, transport_out_desc);
+ if(transport_out_desc)
+ {
+ axis2_msg_ctx_set_transport_out_desc(msg_ctx, env, transport_out_desc);
+ }
axis2_msg_ctx_set_server_side(msg_ctx, env,
sandesha2_msg_store_bean_is_svr_side(msg_store_bean, env));
@@ -648,6 +649,7 @@
{
AXIS2_TRANSPORT_ENUMS transport_out = axis2_transport_out_desc_get_enum(transport_out_desc,
env);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "transport_out:%d", transport_out);
sandesha2_msg_store_bean_set_transport_out(bean, env, transport_out);
}
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c Mon Aug 25 00:37:04 2008
@@ -169,6 +169,7 @@
create_seq_rm_msg = sandesha2_msg_ctx_create(env, create_seq_msg_ctx);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "create_seq_internal_seq_id:%s", internal_seq_id);
rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, seq_prop_mgr);
if(!rm_version)
@@ -1013,22 +1014,22 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *ref_rm_msg_ctx,
axis2_char_t *make_conn_seq_id,
+ const axis2_char_t *internal_seq_id,
axis2_char_t *make_conn_anon_uri,
sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *ref_msg_ctx = NULL;
axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
axis2_char_t *rm_ns_value = NULL;
- axis2_char_t *rm_version = NULL;
axis2_char_t *wsa_action = NULL;
sandesha2_make_connection_t *make_conn = NULL;
sandesha2_msg_ctx_t *make_conn_rm_msg_ctx = NULL;
+ rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, SANDESHA2_SPEC_VERSION_1_1);
+
if(ref_rm_msg_ctx)
{
ref_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ref_rm_msg_ctx, env);
- rm_ns_value = sandesha2_msg_ctx_get_rm_ns_val(ref_rm_msg_ctx, env);
- rm_version = sandesha2_msg_ctx_get_rm_spec_ver(ref_rm_msg_ctx, env);
}
make_conn_msg_ctx = sandesha2_utils_create_new_related_msg_ctx(env, ref_rm_msg_ctx);
@@ -1053,7 +1054,6 @@
axutil_array_list_t *new_flow = axutil_array_list_create(env, 0);
for(i = 0; i < size; i++)
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came8");
const axis2_phase_t *phase = axutil_array_list_get(out_flow, env, i);
const axis2_char_t *phase_name = axis2_phase_get_name(phase, env);
if(0 == axutil_strcmp(phase_name, AXIS2_PHASE_MESSAGE_OUT))
@@ -1095,14 +1095,18 @@
if(make_conn_anon_uri)
{
- sandesha2_address_t *address = sandesha2_address_create(env,
- rm_ns_value, NULL);
- axis2_endpoint_ref_t *epr = axis2_endpoint_ref_create(env,
- make_conn_anon_uri);
+ sandesha2_address_t *address = sandesha2_address_create(env, rm_ns_value, NULL);
+ axis2_endpoint_ref_t *epr = axis2_endpoint_ref_create(env, make_conn_anon_uri);
+
if(address)
+ {
sandesha2_address_set_epr(address, env, epr);
+ }
+
if(make_conn)
+ {
sandesha2_make_connection_set_address(make_conn, env, address);
+ }
}
if(make_conn_msg_ctx)
@@ -1110,25 +1114,28 @@
axis2_endpoint_ref_t *to = NULL;
axis2_endpoint_ref_t *reply_to = NULL;
axis2_char_t *address = NULL;
+ axutil_string_t *soap_action = NULL;
+
/* Setting the addressing properties */
to = axis2_msg_ctx_get_to(ref_msg_ctx, env);
- address = (axis2_char_t *) axis2_endpoint_ref_get_address(
- (const axis2_endpoint_ref_t *) to, env);
+ address = (axis2_char_t *) axis2_endpoint_ref_get_address((const axis2_endpoint_ref_t *) to, env);
to = axis2_endpoint_ref_create(env, address);
axis2_msg_ctx_set_to(make_conn_msg_ctx, env, to);
reply_to = axis2_endpoint_ref_create(env, AXIS2_WSA_ANONYMOUS_URL);
axis2_msg_ctx_set_reply_to(make_conn_msg_ctx, env, reply_to);
- wsa_action = sandesha2_spec_specific_consts_get_make_connection_action(
- env, rm_version);
+ wsa_action = sandesha2_spec_specific_consts_get_make_connection_action(env, SANDESHA2_SPEC_VERSION_1_1);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "action:%s", wsa_action);
axis2_msg_ctx_set_wsa_action(make_conn_msg_ctx, env, wsa_action);
+ soap_action = axutil_string_create(env, wsa_action);
+ axis2_msg_ctx_set_soap_action(make_conn_msg_ctx, env, soap_action);
axis2_msg_ctx_set_message_id(make_conn_msg_ctx, env, axutil_uuid_gen(env));
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came9");
- sandesha2_msg_ctx_set_make_connection(make_conn_rm_msg_ctx, env,
- make_conn);
+ sandesha2_msg_ctx_set_make_connection(make_conn_rm_msg_ctx, env, make_conn);
+
/* Generating the soap envelope */
sandesha2_msg_ctx_add_soap_envelope(make_conn_rm_msg_ctx, env);
return make_conn_rm_msg_ctx;
}
+
return NULL;
}
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c?rev=688639&r1=688638&r2=688639&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c Mon Aug 25 00:37:04 2008
@@ -913,12 +913,17 @@
temp_addr = sandesha2_seq_property_bean_get_value(to_bean, env);
to_epr = axis2_endpoint_ref_create(env, temp_addr);
+ /*if(!sandesha2_utils_is_anon_uri(env, temp_addr))
+ {
+ to_epr = axis2_endpoint_ref_create(env, temp_addr);
+ }*/
sandesha2_seq_property_bean_free(to_bean, env);
}
if(to_epr)
{
to_addr = axis2_endpoint_ref_get_address(to_epr, env);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "to_addr:%s", to_addr);
sandesha2_msg_ctx_set_to(terminate_rm_msg_ctx, env, to_epr);
}
@@ -953,6 +958,7 @@
sandesha2_spec_specific_consts_get_terminate_seq_action(env, rm_ver));
temp_action = sandesha2_spec_specific_consts_get_terminate_seq_soap_action(env, rm_ver);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "temp_action:%s", temp_action);
soap_action = axutil_string_create(env, temp_action);
if(soap_action)
{
@@ -970,12 +976,12 @@
sandesha2_msg_ctx_set_property(terminate_rm_msg_ctx, env, AXIS2_TRANSPORT_URL, property);
}
- sandesha2_msg_ctx_add_soap_envelope(terminate_rm_msg_ctx, env);
/* If server side and single channel duplex mode send the terminate sequence message.
*/
if(sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_ver, to_addr))
{
+ sandesha2_msg_ctx_add_soap_envelope(terminate_rm_msg_ctx, env);
axis2_op_ctx_set_response_written(axis2_msg_ctx_get_op_ctx(terminate_msg_ctx, env), env, AXIS2_TRUE);
axis2_msg_ctx_set_paused(ack_msg_ctx, env, AXIS2_TRUE);
axis2_op_ctx_set_response_written(axis2_msg_ctx_get_op_ctx(ack_msg_ctx, env), env, AXIS2_TRUE);
@@ -991,8 +997,8 @@
}
/* Clean sending side data */
- sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, internal_sequence_id,
- is_svr_side, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
+ /*sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, internal_sequence_id,
+ is_svr_side, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);*/
terminate_added = sandesha2_seq_property_bean_create(env);
if(terminate_added)
@@ -1041,10 +1047,18 @@
AXIS2_FREE(env->allocator, rm_ver);
}
+ sandesha2_msg_ctx_add_soap_envelope(terminate_rm_msg_ctx, env);
+
+ if(!sandesha2_util_is_ack_already_piggybacked(env, terminate_rm_msg_ctx))
+ {
+ sandesha2_ack_mgr_piggyback_acks_if_present(env, rms_sequence_id, terminate_rm_msg_ctx,
+ storage_mgr, seq_prop_mgr, sender_mgr);
+ }
+
key = axutil_uuid_gen(env);
terminate_sender_bean = sandesha2_sender_bean_create(env);
sandesha2_sender_bean_set_msg_ctx_ref_key(terminate_sender_bean, env, key);
- sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key, terminate_msg_ctx, AXIS2_TRUE);
+ /*sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key, terminate_msg_ctx, AXIS2_TRUE);*/
property_bean = sandesha2_utils_get_property_bean(env, axis2_conf_ctx_get_conf(conf_ctx, env));
terminate_delay = sandesha2_property_bean_get_terminate_delay(property_bean, env);
send_time = sandesha2_utils_get_current_time_in_millis(env) + terminate_delay;
@@ -1076,12 +1090,6 @@
env, reply_to_epr));
}
- if(!sandesha2_util_is_ack_already_piggybacked(env, terminate_rm_msg_ctx))
- {
- sandesha2_ack_mgr_piggyback_acks_if_present(env, rms_sequence_id, terminate_rm_msg_ctx,
- storage_mgr, seq_prop_mgr, sender_mgr);
- }
-
is_svr_side = sandesha2_msg_ctx_get_server_side(ack_rm_msg_ctx, env); /* Do we need this?:damitha */
engine = axis2_engine_create(env, conf_ctx);
@@ -1091,7 +1099,16 @@
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] replay on");
}
- if(AXIS2_SUCCESS == axis2_engine_send(engine, env, terminate_msg_ctx))
+ if(sandesha2_utils_is_anon_uri(env, to_addr))
+ {
+ axis2_transport_out_desc_t *sandesha2_transport_out = NULL;
+
+ sandesha2_transport_out = sandesha2_utils_get_transport_out(env);
+ axis2_msg_ctx_set_transport_out_desc(terminate_msg_ctx, env, sandesha2_transport_out);
+ axis2_engine_send(engine, env, terminate_msg_ctx);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] RM 1.1 replay");
+ }
+ else if(AXIS2_SUCCESS == axis2_engine_send(engine, env, terminate_msg_ctx))
{
if(replay_bean)
{
@@ -1191,6 +1208,8 @@
}
}
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key, terminate_msg_ctx, AXIS2_TRUE);
+
if(terminate_sender_bean)
{
sandesha2_sender_bean_free(terminate_sender_bean, env);
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org