Author: samisa
Date: Wed Feb 21 00:10:53 2007
New Revision: 509933

URL: http://svn.apache.org/viewvc?view=rev&rev=509933
Log:
Some more fixes to get the single channel working

Modified:
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c
    webservices/sandesha/trunk/c/src/util/msg_creator.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/util/seq_mgr.c

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
(original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
Wed Feb 21 00:10:53 2007
@@ -118,7 +118,7 @@
     AXIS2_OPTIONS_SET_ACTION(options, env,
         "http://127.0.0.1:8080/axis2/services/RMSampleService/anonOutInOp";);
     reply_to = axis2_endpoint_ref_create(env, AXIS2_WSA_ANONYMOUS_URL);
-    AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);
+    /*AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);*/
 
     /* Set up deploy folder. It is from the deploy folder, the configuration 
is 
      * picked up using the axis2.xml file.

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Wed Feb 
21 00:10:53 2007
@@ -243,6 +243,7 @@
         env, rm_msg_ctx, storage_mgr);
     if(fault_ctx)
     {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"sandesha2_app_msg_processor_process_in_msg send Fault");
         axis2_engine_t *engine = axis2_engine_create(env, conf_ctx);
         if(!AXIS2_ENGINE_SEND_FAULT(engine, env, 
             sandesha2_msg_ctx_get_msg_ctx(fault_ctx, env)))
@@ -486,13 +487,16 @@
         reply_to_addr = axis2_endpoint_ref_get_address(reply_to_epr, env);
     if(to_epr)
         to_addr = axis2_endpoint_ref_get_address(to_epr, env);
-    if(sandesha2_utils_is_single_channel(env, rm_version, reply_to_addr))
+    if(axis2_msg_ctx_get_to(msg_ctx, env) && 
+        sandesha2_utils_is_single_channel(env, rm_version, reply_to_addr))
     {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "*******************single 
channel1******************");
         /* Do nothing */
     } 
     else
         if(sandesha2_utils_is_single_channel(env, rm_version, to_addr))
     {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "*******************single 
channel2******************");
         sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx, 
msgs_str, 
             storage_mgr);
     }
@@ -581,9 +585,9 @@
     is_svr_side = AXIS2_MSG_CTX_GET_SERVER_SIDE(msg_ctx, env);
     
     to_epr = AXIS2_MSG_CTX_GET_TO(msg_ctx, env);
-    if(!to_epr || !AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env)
+    if((!to_epr || !AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env)
         || 0 == AXIS2_STRLEN(AXIS2_ENDPOINT_REF_GET_ADDRESS(
-            to_epr, env)))
+            to_epr, env))) && !is_svr_side)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "to epr is not set - a" 
             "requirement in sandesha client side");
@@ -922,7 +926,8 @@
     }
     op_name = AXIS2_QNAME_GET_LOCALPART(AXIS2_OP_GET_QNAME(AXIS2_OP_CTX_GET_OP(
         axis2_msg_ctx_get_op_ctx(msg_ctx, env), env), env), env);
-    to_addr = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    if (to_epr)
+        to_addr = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
     /* test code */
     /*if(!AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env))
         AXIS2_MSG_CTX_SET_WSA_ACTION(msg_ctx, env, axis2_strcat(env, to_addr, 
@@ -1219,18 +1224,30 @@
         internal_seq_id, SANDESHA2_SEQ_PROP_REPLY_TO_EPR);
     out_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
         internal_seq_id, SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
-    if(!to_bean)
+    /*if(!to_bean)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] To is NULL");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_TO, AXIS2_FAILURE);
         return AXIS2_FAILURE;
+    }*/
+
+    if (to_bean)
+    {
+        to_epr = axis2_endpoint_ref_create(env, 
+            sandesha2_seq_property_bean_get_value(to_bean, env));
     }
-    to_epr = axis2_endpoint_ref_create(env, 
-        sandesha2_seq_property_bean_get_value(to_bean, env));
+    
     if(reply_to_bean)
+    {
         reply_to_epr = axis2_endpoint_ref_create(env, 
             sandesha2_seq_property_bean_get_value(reply_to_bean, env));
-    to_addr = axis2_endpoint_ref_get_address(to_epr, env);
+    }
+    
+    if (to_epr)
+    {
+        to_addr = axis2_endpoint_ref_get_address(to_epr, env);
+    }
+    
     if(AXIS2_MSG_CTX_GET_SERVER_SIDE(app_msg_ctx, env))
     {
         axis2_endpoint_ref_t *reply_to = NULL;
@@ -1248,7 +1265,7 @@
     if(new_to_str)
         sandesha2_msg_ctx_set_to(rm_msg_ctx, env, 
axis2_endpoint_ref_create(env, 
             new_to_str));
-    else
+    else if (to_epr)
         sandesha2_msg_ctx_set_to(rm_msg_ctx, env, to_epr);
 
     /*if(reply_to_epr)
@@ -1327,6 +1344,7 @@
     /* TODO add_ack_requested */
     sandesha2_msg_ctx_add_soap_envelope(rm_msg_ctx, env);
     app_msg_entry = sandesha2_sender_bean_create(env);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "sandesha to_addr = %s ", 
to_addr);
     if(axis2_msg_ctx_get_server_side(app_msg_ctx, env) &&
        sandesha2_utils_is_single_channel(env, rm_version, to_addr))
     {
@@ -1359,6 +1377,7 @@
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Sequence ID is NULL");
             return AXIS2_FAILURE;
         }
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "sandesha to_addr = %s 
sandesha2_msg_creator_add_ack_msg", to_addr);
         sandesha2_msg_creator_add_ack_msg(env, rm_msg_ctx, incoming_seq_id, 
             storage_mgr);
         engine = axis2_engine_create(env, axis2_msg_ctx_get_conf_ctx(msg_ctx, 

Modified: 
webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c 
Wed Feb 21 00:10:53 2007
@@ -1030,6 +1030,7 @@
     if(property)
     {
         axis2_char_t *value = AXIS2_PROPERTY_GET_VALUE(property, env);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "*************qualified for 
sending added value = %s", value);
         prop_str = axis2_strcat(env, SANDESHA2_QUALIFIED_FOR_SENDING,
             SANDESHA2_PERSISTANT_PROPERTY_SEPERATOR, value, NULL);
     }
@@ -1041,6 +1042,7 @@
             property, AXIS2_FALSE);
         prop_str = axis2_strcat(env, SANDESHA2_QUALIFIED_FOR_SENDING,
             SANDESHA2_PERSISTANT_PROPERTY_SEPERATOR, SANDESHA2_VALUE_FALSE, 
NULL);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "*************qualified for 
sending added value = %s", SANDESHA2_VALUE_FALSE);
     }
     property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, 
         AXIS2_WSA_VERSION, AXIS2_FALSE);

Modified: 
webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c 
(original)
+++ webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c Wed 
Feb 21 00:10:53 2007
@@ -183,6 +183,7 @@
     storage_man = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
     
     property = axis2_property_create_with_args(env, 0, 0, 0, 
SANDESHA2_VALUE_TRUE);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "*****************qualified for 
sending *****************");
     AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, SANDESHA2_QUALIFIED_FOR_SENDING,
                         property, AXIS2_FALSE);
     sandesha2_storage_mgr_update_msg_ctx(storage_man, env, key, msg_ctx);

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?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Wed Feb 21 00:10:53 2007
@@ -179,11 +179,18 @@
     if (!to_epr)
     {
         temp_to = sandesha2_msg_ctx_get_to(application_rm_msg, env); 
-        to_epr = axis2_endpoint_ref_create(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(
-            temp_to, env));
+        if (temp_to)
+        {
+            to_epr = axis2_endpoint_ref_create(env, 
AXIS2_ENDPOINT_REF_GET_ADDRESS(
+                temp_to, env));
+        }
+    }
+
+    if (to_epr)
+    {
+        AXIS2_MSG_CTX_SET_TO(create_seq_msg_ctx, env, to_epr);
+        to_epr = NULL;
     }
-    AXIS2_MSG_CTX_SET_TO(create_seq_msg_ctx, env, to_epr);
-    to_epr = NULL;
     
     temp_reply_to = sandesha2_msg_ctx_get_reply_to(application_rm_msg, env); 
     AXIS2_MSG_CTX_SET_REPLY_TO(create_seq_msg_ctx, env, temp_reply_to);
@@ -229,13 +236,22 @@
             internal_seq_id, SANDESHA2_SEQ_PROP_REPLY_TO_EPR);
     to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
             internal_seq_id, SANDESHA2_SEQ_PROP_TO_EPR);
-    temp_value = sandesha2_seq_property_bean_get_value(to_bean, env);
-    if(!to_bean || !temp_value)
+    if (to_bean)
+    {
+        temp_value = sandesha2_seq_property_bean_get_value(to_bean, env);
+    }
+    
+    /*if(!to_bean || !temp_value)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_EPR_NOT_SET, 
AXIS2_FAILURE);
         return NULL;
+    }*/
+
+    if (temp_value)
+    {
+        to_epr = axis2_endpoint_ref_create(env, temp_value);
     }
-    to_epr = axis2_endpoint_ref_create(env, temp_value);
+
     anonymous_uri = sandesha2_spec_specific_consts_get_anon_uri(env, 
             addressing_ns_value);
     if(!acks_to || 0 == AXIS2_STRCMP("", acks_to))
@@ -243,13 +259,13 @@
         acks_to = AXIS2_STRDUP(anonymous_uri, env);
     }
     acks_to_epr = axis2_endpoint_ref_create(env, acks_to);
-    if(reply_to_bean && temp_value)
+    if(reply_to_bean)
     {
         temp_value = sandesha2_seq_property_bean_get_value(reply_to_bean, env);
         reply_to_epr = axis2_endpoint_ref_create(env, temp_value);
     }
     temp_to = sandesha2_msg_ctx_get_to(create_seq_rm_msg, env);
-    if(!temp_to)
+    if(!temp_to && to_epr)
         sandesha2_msg_ctx_set_to(create_seq_rm_msg, env, to_epr);
     /* ReplyTo will be set only if not NULL */
     if(reply_to_epr)

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Wed Feb 21 00:10:53 
2007
@@ -1278,7 +1278,7 @@
 {
     axis2_char_t *address_l = NULL;
     if(!address)
-        return AXIS2_FALSE;
+        return AXIS2_TRUE;
     address_l = AXIS2_STRTRIM(env, address, NULL);
 
     if(0 == AXIS2_STRCMP(AXIS2_WSA_ANONYMOUS_URL, address_l))

Modified: webservices/sandesha/trunk/c/src/util/seq_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/seq_mgr.c?view=diff&rev=509933&r1=509932&r2=509933
==============================================================================
--- webservices/sandesha/trunk/c/src/util/seq_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/seq_mgr.c Wed Feb 21 00:10:53 2007
@@ -384,16 +384,19 @@
                         SANDESHA2_CLIENT_ACKS_TO, AXIS2_FALSE);
     if(property)
         acks_to_str = AXIS2_PROPERTY_GET_VALUE(property, env);
-    if(!to_epr)
+    /*if(!to_epr)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] WSA To is NULL");
         return AXIS2_FAILURE;
-    }
-    
-    to_bean = sandesha2_seq_property_bean_create_with_data(env, int_seq_id,
+    }*/
+   
+    if (to_epr)
+    {
+        to_bean = sandesha2_seq_property_bean_create_with_data(env, int_seq_id,
                        SANDESHA2_SEQ_PROP_TO_EPR, 
                        (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, 
                        env));
+    }
     
     if(AXIS2_MSG_CTX_GET_SERVER_SIDE(first_app_msg, env))
     {
@@ -463,7 +466,10 @@
     msgs_bean = sandesha2_seq_property_bean_create_with_data(env, int_seq_id, 
                         SANDESHA2_SEQ_PROP_CLIENT_COMPLETED_MESSAGES, "");
     sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, msgs_bean);
-    sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, to_bean);
+    if (to_bean)
+    {
+        sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, to_bean);
+    }
     
     if(acks_to_bean)
         sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, acks_to_bean);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to