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 2007/02/23 14:53:29 UTC

svn commit: r510947 - in /webservices/sandesha/trunk/c: config/module.xml samples/rm_echo_single_1_0/rm_echo_single.c samples/rm_mtom_1_0/mtom_util.c src/handlers/sandesha2_out_handler.c src/storage/permanent/permanent_storage_mgr.c

Author: damitha
Date: Fri Feb 23 05:53:29 2007
New Revision: 510947

URL: http://svn.apache.org/viewvc?view=rev&rev=510947
Log:
rm_echo_single_1_0 sample return the response envelope to the client. But this is not constent. Some times the application response appear to come from the tcpmon still it does not reach the client.Also when there are more than one message in the single only first message give
the response envelope.

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
    webservices/sandesha/trunk/c/samples/rm_mtom_1_0/mtom_util.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?view=diff&rev=510947&r1=510946&r2=510947
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Fri Feb 23 05:53:29 2007
@@ -68,7 +68,7 @@
     </operation>
 
    <!-- Database connection parameters -->
-   <parameter name="sandesha2_db" locked="false">/tmp</parameter>
+   <parameter name="sandesha2_db" locked="false">/axis2c/deploy</parameter>
    <!-- General parameters -->
     <parameter name="ExponentialBackoff" locked="false">AXIS2_TRUE</parameter>
     <parameter name="RetransmissionInterval" locked="false">20000</parameter>

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=510947&r1=510946&r2=510947
==============================================================================
--- 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 Fri Feb 23 05:53:29 2007
@@ -180,16 +180,45 @@
     }
     
     /*payload = build_om_payload_for_echo_svc(env, "echo1", "sequence1");
-    status = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
-    if(status)
+    result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
         printf("\necho client single channel invoke SUCCESSFUL!\n");
+    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);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
+    }
     payload = NULL;
     AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
 
     payload = build_om_payload_for_echo_svc(env, "echo2", "sequence1");
-    status = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
-    if(status)
+    result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+    if(result)
         printf("\necho client single channel invoke SUCCESSFUL!\n");
+    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);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
+    }
     payload = NULL;
     AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
     */
@@ -202,8 +231,15 @@
         axis2_char_t *om_str = NULL;
         om_str = AXIOM_NODE_TO_STRING(result, env);
         if (om_str)
-            printf("\nSending OM : %s\n", om_str);
-        printf("\necho client single channel invoke SUCCESSFUL!\n");
+            printf("\nReceived OM : %s\n", om_str);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
     }
     payload = NULL;
 

Modified: webservices/sandesha/trunk/c/samples/rm_mtom_1_0/mtom_util.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_mtom_1_0/mtom_util.c?view=diff&rev=510947&r1=510946&r2=510947
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_mtom_1_0/mtom_util.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_mtom_1_0/mtom_util.c Fri Feb 23 05:53:29 2007
@@ -50,7 +50,7 @@
     data_handler = axiom_data_handler_create(env, image_name, "image/jpeg");
     data_text = axiom_text_create_with_data_handler(env, image_om_node, 
             data_handler, &data_om_node);
-    printf("%s", AXIOM_NODE_TO_STRING(mtom_om_node, env));
+    /*printf("%s", AXIOM_NODE_TO_STRING(mtom_om_node, env));*/
     return mtom_om_node;
 }
 

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c?view=diff&rev=510947&r1=510946&r2=510947
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Fri Feb 23 05:53:29 2007
@@ -30,6 +30,8 @@
 #include <sandesha2_utils.h>
 #include <sandesha2_app_msg_processor.h>
 #include <sandesha2_client_constants.h>
+#include <sandesha2_sender_mgr.h>
+#include <platforms/axis2_platform_auto_sense.h>
 
 axis2_string_t *AXIS2_CALL
 sandesha2_out_handler_get_name(
@@ -236,6 +238,96 @@
     if(temp_prop)
         axis2_property_set_value(temp_prop, env, AXIS2_STRDUP(
             SANDESHA2_VALUE_FALSE, env));
+    if(!axis2_msg_ctx_get_server_side(msg_ctx, env))
+    {
+        axis2_op_t *op = NULL;
+        axis2_op_ctx_t *op_ctx = NULL;
+        axis2_endpoint_ref_t *to_epr = NULL;
+        axis2_endpoint_ref_t *reply_to_epr = NULL;
+        axis2_char_t *reply_to_addr = NULL;
+        axis2_bool_t single_channel_two_way = AXIS2_FALSE;
+        int mep = -1, size = 0, i = 0;
+        op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+        op = axis2_op_ctx_get_op(op_ctx, env);
+        mep = AXIS2_OP_GET_AXIS_SPECIFIC_MEP_CONST(op, env);
+        to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
+        reply_to_epr = axis2_msg_ctx_get_reply_to(msg_ctx, env);
+        if(reply_to_epr)
+            reply_to_addr = axis2_endpoint_ref_get_address(reply_to_epr, env);
+        single_channel_two_way = (sandesha2_utils_is_anon_uri(env, 
+            reply_to_addr)) && AXIS2_MEP_CONSTANT_OUT_IN == mep;
+        if(single_channel_two_way)
+        {
+            axis2_char_t *to = NULL;
+            axis2_property_t *property = NULL;
+            axis2_char_t *seq_key = NULL;
+            sandesha2_sender_mgr_t *retrans_mgr = NULL;
+            sandesha2_sender_bean_t *target_bean = NULL;
+            axis2_array_list_t *found_list = NULL;
+            axis2_char_t *msg_id = NULL;
+            axis2_char_t *internal_seq_id = NULL;
+            axis2_bool_t match = AXIS2_FALSE;
+
+            printf("single channel two way\n");
+            target_bean = sandesha2_sender_bean_create(env);
+            to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+            property = axis2_msg_ctx_get_property(msg_ctx, env, 
+                SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
+            if(property)
+                seq_key = axis2_property_get_value(property, env);
+            internal_seq_id = sandesha2_utils_get_internal_seq_id(env, 
+            to, seq_key);
+            sandesha2_sender_bean_set_internal_seq_id(target_bean, env, internal_seq_id);
+            sandesha2_sender_bean_set_send(target_bean, env, AXIS2_TRUE);
+            sandesha2_sender_bean_set_resend(target_bean, env, AXIS2_TRUE);
+            retrans_mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
+            while(!match)
+            {
+                transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
+                found_list = sandesha2_sender_mgr_find_by_sender_bean(retrans_mgr, env, 
+                    target_bean);
+                msg_id = axis2_msg_ctx_get_msg_id(msg_ctx, env);
+                if(found_list)
+                    size = AXIS2_ARRAY_LIST_SIZE(found_list, env);
+                for(i = 0; i < size; i++)
+                {
+                    sandesha2_sender_bean_t *tmp_bean = NULL;
+                    axis2_char_t *key = NULL;
+                    axis2_msg_ctx_t *app_msg_ctx = NULL;
+                    axis2_char_t *rm_ver = NULL;
+                    axis2_char_t *assumed_rm_ns = NULL;
+                    sandesha2_msg_ctx_t *app_rm_msg = NULL;
+                    sandesha2_seq_t *seq_part = NULL;
+                    sandesha2_identifier_t *ident = NULL;
+                    axis2_char_t *temp_msg_id = NULL;
+                    
+                    tmp_bean = AXIS2_ARRAY_LIST_GET(found_list, env, i);
+                    key = sandesha2_sender_bean_get_msg_ctx_ref_key(tmp_bean, env);
+                    app_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
+                        key, conf_ctx);
+                    if(!app_msg_ctx)
+                    {
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Unavailable"
+                            " application message");
+                        return AXIS2_FAILURE;
+                    }
+                    temp_msg_id = axis2_msg_ctx_get_msg_id(app_msg_ctx, env);
+                    if(0 == axis2_strcmp(msg_id, temp_msg_id))
+                    {
+                        axiom_soap_envelope_t *res_envelope = NULL;
+                        AXIS2_SLEEP(2);
+                        match = AXIS2_TRUE;
+                    }
+                }//for
+                if(!match)
+                {
+                    sandesha2_transaction_commit(transaction, env);
+                    AXIS2_SLEEP(1);
+                }
+            }//while
+            sandesha2_transaction_commit(transaction, env);
+        }
+    }
     AXIS2_LOG_INFO(env->log, "[sandesha2] Exit: sandesha2_out_handler::invoke");
     return AXIS2_SUCCESS;
 }

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=510947&r1=510946&r2=510947
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c Fri Feb 23 05:53:29 2007
@@ -796,10 +796,10 @@
     sandesha2_msg_store_bean_t *msg_store_bean = NULL;
 
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
-    /*msg_ctx = (axis2_msg_ctx_t *) axis2_hash_get(storage_mgr_impl->msg_ctx_map,
+    msg_ctx = (axis2_msg_ctx_t *) axis2_hash_get(storage_mgr_impl->msg_ctx_map,
         key, AXIS2_HASH_KEY_STRING);
     if(msg_ctx)
-        return msg_ctx;*/
+        return msg_ctx;
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "retrieved from database");
     msg_store_bean = sandesha2_permanent_bean_mgr_retrieve_msg_store_bean(
         storage_mgr_impl->bean_mgr, env, key);



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org