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 2009/01/16 10:05:55 UTC

svn commit: r734943 - /webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c

Author: damitha
Date: Fri Jan 16 01:05:55 2009
New Revision: 734943

URL: http://svn.apache.org/viewvc?rev=734943&view=rev
Log:
Updated the sample so that last message goes in as single channel message

Modified:
    webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c

Modified: webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c?rev=734943&r1=734942&r2=734943&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c Fri Jan 16 01:05:55 2009
@@ -33,6 +33,7 @@
 #include <unistd.h>
 
 #define SANDESHA2_MAX_COUNT 8
+extern int usleep (__useconds_t __useconds);
 
 /* on_complete callback function */
 axis2_status_t AXIS2_CALL
@@ -66,7 +67,6 @@
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axis2_callback_t *callback1 = NULL;
-    axis2_callback_t *callback2 = NULL;
     axutil_property_t *property = NULL;
     axutil_string_t *soap_action = NULL;
     axis2_char_t *seq_key = NULL;
@@ -200,7 +200,7 @@
         axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, 
             property);
     }
-    for(i = 1; i < 100; i++)
+    for(i = 1; i < 101; i++)
     {
         axis2_char_t echo_str[7];
         sprintf(echo_str, "%s%d", "echo", i);
@@ -210,17 +210,14 @@
         axis2_callback_set_on_error(callback1, rm_echo_callback_on_error);
         axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback1);
         wait_on_callback(env, callback1);
-        /*AXIS2_SLEEP(1);*/
     }
     axis2_svc_client_remove_all_headers(svc_client, env);
+    
+    axis2_options_set_action(options, env, SANDESHA2_SPEC_2005_02_SOAP_ACTION_LAST_MESSAGE);
     property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
     axis2_options_set_property(options, env, "Sandesha2LastMessage", property);
-    payload = build_om_payload_for_echo_svc(env, "echo100", seq_key);
-    callback2 = axis2_callback_create(env);
-    axis2_callback_set_on_complete(callback2, rm_echo_callback_on_complete);
-    axis2_callback_set_on_error(callback2, rm_echo_callback_on_error);
-    axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback2);
-    wait_on_callback(env, callback2);
+    axis2_svc_client_send_robust(svc_client, env, NULL);
+
     AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
     AXIS2_FREE(env->allocator, seq_key);
     if (svc_client)
@@ -306,7 +303,7 @@
             /* We are done with the callback */
             break;
         }
-        /* AXIS2_SLEEP(1); */
+        usleep(100000);
     }
     return;
 }



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