Return-Path: Delivered-To: apmail-ws-sandesha-dev-archive@www.apache.org Received: (qmail 58842 invoked from network); 14 Aug 2008 15:04:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2008 15:04:28 -0000 Received: (qmail 50781 invoked by uid 500); 14 Aug 2008 15:04:27 -0000 Delivered-To: apmail-ws-sandesha-dev-archive@ws.apache.org Received: (qmail 50712 invoked by uid 500); 14 Aug 2008 15:04:26 -0000 Mailing-List: contact sandesha-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list sandesha-dev@ws.apache.org Received: (qmail 50701 invoked by uid 500); 14 Aug 2008 15:04:26 -0000 Delivered-To: apmail-ws-sandesha-cvs@ws.apache.org Received: (qmail 50698 invoked by uid 99); 14 Aug 2008 15:04:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2008 08:04:26 -0700 X-ASF-Spam-Status: No, hits=-1998.4 required=10.0 tests=ALL_TRUSTED,FRT_LEVITRA,NORMAL_HTTP_TO_IP,URIBL_RHS_DOB X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2008 15:03:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 182982388888; Thu, 14 Aug 2008 08:04:00 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r685933 - /webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c Date: Thu, 14 Aug 2008 15:03:59 -0000 To: sandesha-cvs@ws.apache.org From: damitha@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080814150400.182982388888@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: damitha Date: Thu Aug 14 08:03:58 2008 New Revision: 685933 URL: http://svn.apache.org/viewvc?rev=685933&view=rev Log: updating the sample Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c?rev=685933&r1=685932&r2=685933&view=diff ============================================================================== --- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c (original) +++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_1/rm_echo_single_1_1.c Thu Aug 14 08:03:58 2008 @@ -30,7 +30,7 @@ #include #include -#define SANDESHA2_SLEEP 12 +#define SANDESHA2_SLEEP 2 static void usage( @@ -54,8 +54,7 @@ int c; /* Set up the environment */ - env = axutil_env_create_all("rm_echo_single_1_1.log", - AXIS2_LOG_LEVEL_TRACE); + env = axutil_env_create_all("rm_echo_single_1_1.log", AXIS2_LOG_LEVEL_TRACE); /* Set end point reference of echo service */ @@ -75,17 +74,21 @@ return -1; case '?': if (isprint(optopt)) + { fprintf(stderr, "\nUnknown option `-%c'.\n", optopt); + } usage(argv[0]); return -1; } } + if (axutil_strcmp(address, "-h") == 0) { printf("Usage : %s [endpoint_url] [offer]\n", argv[0]); printf("use -h for help\n"); return 0; } + printf ("Using endpoint : %s\n", address); /* Create EPR with given address */ @@ -98,6 +101,7 @@ /* Seperate listner needs addressing, hence addressing stuff in options */ 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); @@ -111,16 +115,18 @@ */ client_home = AXIS2_GETENV("AXIS2C_HOME"); if (!client_home) + { client_home = "../../deploy"; + } /* Create service client */ svc_client = axis2_svc_client_create(env, client_home); if (!svc_client) { printf("Error creating service client\n"); - 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)); + 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)); + return -1; } @@ -135,42 +141,60 @@ { return AXIS2_FAILURE; } + /* Offer sequence */ offered_seq_id = axutil_uuid_gen(env); property = axutil_property_create(env); if(property) { - axutil_property_set_value(property, env, axutil_strdup(env, - offered_seq_id)); - axis2_options_set_property(options, env, - SANDESHA2_CLIENT_OFFERED_SEQ_ID, property); + axutil_property_set_value(property, env, axutil_strdup(env, offered_seq_id)); + axis2_options_set_property(options, env, SANDESHA2_CLIENT_OFFERED_SEQ_ID, property); } + /* RM Version 1.1 */ - property = axutil_property_create_with_args(env, 3, 0, 0, - SANDESHA2_SPEC_VERSION_1_1); + property = axutil_property_create_with_args(env, 3, 0, 0, SANDESHA2_SPEC_VERSION_1_1); if(property) { - axis2_options_set_property(options, env, - SANDESHA2_CLIENT_RM_SPEC_VERSION, property); + axis2_options_set_property(options, env, SANDESHA2_CLIENT_RM_SPEC_VERSION, property); } + seq_key = axutil_uuid_gen(env); property = axutil_property_create_with_args(env, 3, 0, 0, seq_key); if(property) { - axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, - property); + axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, property); } payload = build_om_payload_for_echo_svc(env, "echo1", seq_key); status = axis2_svc_client_send_robust(svc_client, env, payload); if(status) + { + printf("\necho client single channel invoke SUCCESSFUL!\n"); + } + payload = NULL; + + payload = build_om_payload_for_echo_svc(env, "echo2", seq_key); + status = axis2_svc_client_send_robust(svc_client, env, payload); + if(status) + { + printf("\necho client single channel invoke SUCCESSFUL!\n"); + } + payload = NULL; + + payload = build_om_payload_for_echo_svc(env, "echo3", seq_key); + status = axis2_svc_client_send_robust(svc_client, env, payload); + if(status) + { printf("\necho client single channel invoke SUCCESSFUL!\n"); + } payload = NULL; + AXIS2_SLEEP(SANDESHA2_SLEEP); - sandesha2_client_terminate_seq_with_svc_client_and_seq_key(env, svc_client, - seq_key); + sandesha2_client_terminate_seq_with_svc_client_and_seq_key(env, svc_client, seq_key); + AXIS2_SLEEP(SANDESHA2_SLEEP); + if (svc_client) { axis2_svc_client_free(svc_client, env); --------------------------------------------------------------------- To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org For additional commands, e-mail: sandesha-dev-help@ws.apache.org