You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by da...@apache.org on 2006/10/24 13:16:39 UTC

svn commit: r467308 - in /webservices/sandesha/trunk/c: samples/client/rm_ping/rm_ping_client.c src/msgprocessors/app_msg_processor.c src/msgprocessors/terminate_seq_msg_processor.c src/util/msg_init.c src/workers/sender.c

Author: damitha
Date: Tue Oct 24 04:16:38 2006
New Revision: 467308

URL: http://svn.apache.org/viewvc?view=rev&rev=467308
Log:
Fixed AXIS2C-307

Modified:
    webservices/sandesha/trunk/c/samples/client/rm_ping/rm_ping_client.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/util/msg_init.c
    webservices/sandesha/trunk/c/src/workers/sender.c

Modified: webservices/sandesha/trunk/c/samples/client/rm_ping/rm_ping_client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/client/rm_ping/rm_ping_client.c?view=diff&rev=467308&r1=467307&r2=467308
==============================================================================
--- webservices/sandesha/trunk/c/samples/client/rm_ping/rm_ping_client.c (original)
+++ webservices/sandesha/trunk/c/samples/client/rm_ping/rm_ping_client.c Tue Oct 24 04:16:38 2006
@@ -33,7 +33,9 @@
 {
     const axis2_env_t *env = NULL;
     const axis2_char_t *address = NULL;
+    const axis2_char_t *to = NULL;
     axis2_endpoint_ref_t* endpoint_ref = NULL;
+    axis2_endpoint_ref_t* target_epr = NULL;
     axis2_options_t *options = NULL;
     const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
@@ -47,8 +49,11 @@
 
     /* Set end point reference of echo service */
     address = "http://localhost:9090/axis2/services/rm_ping";
+    to = "http://localhost:9090/axis2/services/rm_ping";
     if (argc > 1 )
+    {
         address = argv[1];
+    }
     if (AXIS2_STRCMP(address, "-h") == 0)
     {
         printf("Usage : %s [endpoint_url]\n", argv[0]);
@@ -58,11 +63,15 @@
     printf ("Using endpoint : %s\n", address);
     
     /* Create EPR with given address */
-    endpoint_ref = axis2_endpoint_ref_create(env, address);
+    endpoint_ref = axis2_endpoint_ref_create(env, to);
+    target_epr = axis2_endpoint_ref_create(env, address);
 
     /* Setup options */
     options = axis2_options_create(env);
     AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
+    property = axis2_property_create(env);
+    AXIS2_PROPERTY_SET_VALUE(property, env, target_epr);
+    AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_TARGET_EPR, property);
     AXIS2_OPTIONS_SET_ACTION(options, env,
         "http://example.org/action/ping");
 
@@ -99,37 +108,17 @@
     
     /* Send request */
     payload = build_om_programatically(env, "ping1");
-    status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
-    if(status == AXIS2_SUCCESS)
-    {
-        printf("\nping client invoke SUCCESSFUL!\n");
-    }
-    else
-    {
-      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
-                  " %d :: %s", env->error->error_number,
-                        AXIS2_ERROR_GET_MESSAGE(env->error));
-        printf("ping client invoke FAILED!\n");
-    }
+    AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
+    printf("\nping client invoke SUCCESSFUL!\n");
 
     property = axis2_property_create(env);
-    AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
+    AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
     AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_VALUE_TRUE);
     AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage", 
             property);
     payload = build_om_programatically(env, "ping2");
-    status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
-    if(status == AXIS2_SUCCESS)
-    {
-        printf("\nping client invoke SUCCESSFUL!\n");
-    }
-    else
-    {
-      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
-                  " %d :: %s", env->error->error_number,
-                        AXIS2_ERROR_GET_MESSAGE(env->error));
-        printf("ping client invoke FAILED!\n");
-    }
+    AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
+    printf("\nping client invoke SUCCESSFUL!\n");
      /** Wait till callback is complete. Simply keep the parent thread running
        until our on_complete or on_error is invoked */
 

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=467308&r1=467307&r2=467308
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Tue Oct 24 04:16:38 2006
@@ -371,6 +371,7 @@
                         highest_in_msg_key_str);
         SANDESHA2_STORAGE_MGR_REMOVE_MSG_CTX(storage_mgr, env, 
                         highest_in_msg_key_str);
+        AXIS2_MSG_CTX_SET_KEEP_ALIVE(msg_ctx, env, AXIS2_TRUE);
         SANDESHA2_STORAGE_MGR_STORE_MSG_CTX(storage_mgr, env, 
                         highest_in_msg_key_str, msg_ctx);
         if(NULL != highest_in_msg_no_str)
@@ -484,6 +485,7 @@
                         incoming_seq_list_bean);
         }
         /* save the message */
+        AXIS2_MSG_CTX_SET_KEEP_ALIVE(msg_ctx, env, AXIS2_TRUE);
         SANDESHA2_STORAGE_MGR_STORE_MSG_CTX(storage_mgr, env, str_key, 
                         msg_ctx);
         invoker_bean = sandesha2_invoker_bean_create_with_data(env, str_key,
@@ -1320,6 +1322,7 @@
                             SANDESHA2_SET_SEND_TO_TRUE, property, AXIS2_FALSE);
     }
     SANDESHA2_SENDER_BEAN_SET_INTERNAL_SEQ_ID(app_msg_entry, env, internal_seq_id);
+    AXIS2_MSG_CTX_SET_KEEP_ALIVE(app_msg_ctx, env, AXIS2_TRUE);
     SANDESHA2_STORAGE_MGR_STORE_MSG_CTX(mgr, env, storage_key, app_msg_ctx);
     SANDESHA2_SENDER_MGR_INSERT(retransmitter_man, env, app_msg_entry);
     
@@ -1356,6 +1359,7 @@
     AXIS2_MSG_CTX_SET_CURRENT_HANDLER_INDEX(app_msg_ctx, env, 
                         AXIS2_MSG_CTX_GET_CURRENT_HANDLER_INDEX(app_msg_ctx, env) + 1);
     engine = axis2_engine_create(env, AXIS2_MSG_CTX_GET_CONF_CTX(app_msg_ctx, env));
+    AXIS2_MSG_CTX_SET_KEEP_ALIVE(app_msg_ctx, env, AXIS2_FALSE);
     return AXIS2_ENGINE_RESUME_SEND(engine, env, app_msg_ctx);
 }
 

Modified: webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c?view=diff&rev=467308&r1=467307&r2=467308
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c Tue Oct 24 04:16:38 2006
@@ -302,6 +302,7 @@
         sandesha2_seq_property_bean_t *last_in_msg_bean = NULL;
         axis2_msg_ctx_t *highest_in_msg = NULL;
         axis2_msg_ctx_t *highest_out_msg = NULL;
+        axis2_op_ctx_t *op_ctx = NULL;
         
         last_in_msg_bean = sandesha2_seq_property_bean_create_with_data(env,
                         seq_id, SANDESHA2_SEQ_PROP_LAST_IN_MESSAGE_NO,
@@ -309,9 +310,13 @@
         SANDESHA2_SEQ_PROPERTY_MGR_INSERT(seq_prop_mgr, env, last_in_msg_bean);
         highest_in_msg = SANDESHA2_STORAGE_MGR_RETRIEVE_MSG_CTX(storage_man, env,
                         highest_msg_key, conf_ctx);
-        highest_out_msg = AXIS2_OP_CTX_GET_MSG_CTX(AXIS2_MSG_CTX_GET_OP_CTX(
-                        highest_in_msg, env), env, 
-                        AXIS2_WSDL_MESSAGE_LABEL_OUT_VALUE);
+        if(highest_in_msg)
+            op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(highest_in_msg, env);
+        /* temporarily comment this and add the line below. This is because
+         * highest_out_msg is gargage otherwise */
+        if(op_ctx)
+            highest_out_msg = AXIS2_OP_CTX_GET_MSG_CTX(op_ctx, env, 
+                AXIS2_WSDL_MESSAGE_LABEL_OUT_VALUE);
         if(NULL != highest_out_msg)
         {
             sandesha2_msg_ctx_t *highest_out_rm_msg = NULL;

Modified: webservices/sandesha/trunk/c/src/util/msg_init.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_init.c?view=diff&rev=467308&r1=467307&r2=467308
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Tue Oct 24 04:16:38 2006
@@ -127,7 +127,8 @@
     /* If client side and the addressing version is not set. 
      * Assuming the default addressing version.
      */
-    ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
+    if(msg_ctx)
+        ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
     prop = AXIS2_CTX_GET_PROPERTY(ctx, env, AXIS2_WSA_VERSION, AXIS2_FALSE);
     if(NULL != prop)
         addressing_ns = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE(prop, env);

Modified: webservices/sandesha/trunk/c/src/workers/sender.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender.c?view=diff&rev=467308&r1=467307&r2=467308
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Tue Oct 24 04:16:38 2006
@@ -592,6 +592,7 @@
             AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, 
                         SANDESHA2_WITHIN_TRANSACTION, property, AXIS2_FALSE);
             /* Consider building soap envelope */
+            AXIS2_MSG_CTX_SET_KEEP_ALIVE(msg_ctx, env, AXIS2_FALSE);
             AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
             successfully_sent = AXIS2_TRUE;
         sender_impl->counter++;



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