svn commit: r700692 - /webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c

[email protected]
Newsgroups gmane.comp.apache.webservices.fx.devel
Message-ID <[email protected]>
Author: damitha
Date: Tue Sep 30 23:47:12 2008
New Revision: 700692

URL: http://svn.apache.org/viewvc?rev=700692&view=rev
Log:
updating the samples

Modified:
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.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?rev=700692&r1=700691&r2=700692&view=diff
==============================================================================
--- 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 Tue Sep 30 23:47:12 2008
@@ -45,7 +45,6 @@
     axis2_options_t *options = NULL;
     const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
-    axiom_node_t *payload2 = NULL;
     axutil_property_t *property = NULL;
     axis2_char_t *offered_seq_id = NULL;
     axiom_node_t *result = NULL;
@@ -54,6 +53,7 @@
     axis2_status_t status = AXIS2_FAILURE;
     neethi_policy_t *policy = NULL;
     int c, i;
+    axis2_endpoint_ref_t *reply_to = NULL;
    
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_single_1_0.log", 
@@ -95,7 +95,10 @@
     options = axis2_options_create(env);
     axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
     axis2_options_set_to(options, env, endpoint_ref);
-    
+
+    reply_to = axis2_endpoint_ref_create(env, AXIS2_WSA_ANONYMOUS_URL);
+    axis2_options_set_reply_to(options, env, reply_to);
+
     soap_action = axutil_string_create(env, "urn:wsrm:EchoString");
     axis2_options_set_soap_action(options, env, soap_action);
     if(soap_action)
@@ -184,8 +187,10 @@
     for(i = 1; i < 3; i++)
     {
         axiom_node_t *payload = NULL;
-
-        payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
+        axis2_char_t echo_str[7];
+        
+        sprintf(echo_str, "%s%d", "echo", i);
+        payload = build_om_payload_for_echo_svc(env, echo_str, seq_key);
         result = axis2_svc_client_send_receive(svc_client, env, payload);
         if(result)
         {
@@ -205,19 +210,12 @@
         }
     }
 
+    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);
-    payload2 = build_om_payload_for_echo_svc(env, "echo3", seq_key);
-    result = axis2_svc_client_send_receive(svc_client, env, payload2);
-    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);
-        }
+    status = axis2_svc_client_send_robust(svc_client, env, NULL);
+    if(AXIS2_SUCCESS == status)
+    {
         printf("\necho client two way single channel invoke SUCCESSFUL!\n");
         result = NULL;
     }
@@ -225,6 +223,7 @@
     {
         printf("\necho client two way single channel invoke FAILED!\n");
     }
+
     AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
     AXIS2_FREE(env->allocator, seq_key);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.