axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r920446 - in /axis/axis2/c/sandesha/trunk/samples/rm_amqp: rm_echo_dual_1_0/ rm_echo_dual_1_1/ rm_echo_single_1_0/ rm_echo_single_1_1/ rm_mtom_1_0/ rm_ping_1_0/ rm_ping_1_1/
Date Mon, 08 Mar 2010 18:48:37 GMT
Author: damitha
Date: Mon Mar  8 18:48:36 2010
New Revision: 920446

URL: http://svn.apache.org/viewvc?rev=920446&view=rev
Log: (empty)

Modified:
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_0/rm_echo.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_1/rm_echo_1_1.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.h
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/rm_echo_single.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.h
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/rm_echo_single_1_1.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_mtom_1_0/rm_mtom_1_0.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_0/rm_ping_1_0.c
    axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_1/rm_ping_1_1.c

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_0/rm_echo.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_0/rm_echo.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_0/rm_echo.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_0/rm_echo.c Mon Mar  8 18:48:36
2010
@@ -50,10 +50,6 @@
     const axutil_env_t *env,
     axis2_callback_t *callback);
 
-static void 
-usage(
-    axis2_char_t *prog_name);
-
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
@@ -69,7 +65,6 @@
     axutil_string_t *soap_action = NULL;
     axis2_char_t *seq_key = NULL;
     axis2_char_t *offered_seq_id = NULL;
-    int c;
     int i = 0;
     neethi_policy_t *policy = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -82,30 +77,19 @@
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM10SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
-    {
 
-        switch (c)
+    if (argc > 1)
+    {
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[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);
     
@@ -312,16 +296,4 @@
     return;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The" \
-        " default is amqp://127.0.0.1:5672/axis2/services/RM10SampleService \n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
-
 

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_1/rm_echo_1_1.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_1/rm_echo_1_1.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_1/rm_echo_1_1.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_dual_1_1/rm_echo_1_1.c Mon Mar  8
18:48:36 2010
@@ -51,10 +51,6 @@
     const axutil_env_t *env,
     axis2_callback_t *callback);
 
-static void 
-usage(
-    axis2_char_t *prog_name);
-
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
@@ -72,7 +68,6 @@
     axis2_char_t *offered_seq_id = NULL;
     axis2_bool_t offer = AXIS2_TRUE;
     axis2_char_t *seq_key = NULL;
-    int c;
     extern char *optarg;
     extern int optopt;
     neethi_policy_t *policy = NULL;
@@ -83,39 +78,19 @@
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM11SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:o:")) != -1)
+    if (argc > 1)
     {
-
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case 'o': /* Sequence Offer */
-                offer = AXIS2_ATOI(optarg);
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                {
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                }
-
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[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 */
@@ -317,19 +292,4 @@
     return;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " [-o OFFER]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-o OFFER \t seq offer value.. Type 1 for sequence offer" \
-        "feature. The default behaviour is no offer(0). \n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The" \
-        " default is amqp://127.0.0.1:5672/axis2/services/RM11SampleService \n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
-
 

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.c Mon Mar  8
18:48:36 2010
@@ -20,15 +20,12 @@
 axiom_node_t *
 build_om_payload_for_echo_svc(
    const axutil_env_t *env,
-   axis2_char_t *text,
-   axis2_char_t *seq)
+   axis2_char_t *text)
 {
     axiom_node_t *echo_om_node = NULL;
     axiom_element_t* echo_om_ele = NULL;
     axiom_node_t* text_om_node = NULL;
     axiom_element_t * text_om_ele = NULL;
-    axiom_node_t* seq_om_node = NULL;
-    axiom_element_t * seq_om_ele = NULL;
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *om_str = NULL;
     axis2_char_t *ns = NULL;
@@ -38,9 +35,7 @@
     ns1 = axiom_namespace_create (env, ns, "ns1");
     echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
     text_om_ele = axiom_element_create(env, echo_om_node, "Text", NULL, &text_om_node);
-    seq_om_ele = axiom_element_create(env, echo_om_node, "Sequence", NULL, &seq_om_node);
     axiom_element_set_text(text_om_ele, env, text, text_om_node);
-    axiom_element_set_text(seq_om_ele, env, seq, seq_om_node);
     
     om_str = axiom_node_to_string(echo_om_node, env);
     if (om_str)

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.h?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.h (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/echo_util.h Mon Mar  8
18:48:36 2010
@@ -23,7 +23,6 @@
 axiom_node_t *
 build_om_payload_for_echo_svc(
    const axutil_env_t *env,
-   axis2_char_t *text,
-   axis2_char_t *seq);
+   axis2_char_t *text);
 
 #endif

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/rm_echo_single.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/rm_echo_single.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/rm_echo_single.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_0/rm_echo_single.c Mon Mar
 8 18:48:36 2010
@@ -33,10 +33,6 @@
 
 #define SANDESHA2_MAX_COUNT 2
 
-static void 
-usage(
-    axis2_char_t *prog_name);
-
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
@@ -49,13 +45,12 @@
     axis2_char_t *offered_seq_id = NULL;
     axiom_node_t *result = NULL;
     axutil_string_t *soap_action = NULL;
-    axis2_char_t *seq_key = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     neethi_policy_t *policy = NULL;
-    int c, i;
     extern char *optarg;
     extern int optopt;
     axis2_endpoint_ref_t *reply_to = NULL;
+    int i = -1;
    
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_single_1_0_amqp.log", 
@@ -63,30 +58,18 @@
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM10SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
+    if (argc > 1)
     {
-
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[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);
     
@@ -171,13 +154,6 @@
         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, 0, 0, 0, seq_key);
-    if(property)
-    {
-        axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, 
-            property);
-    }
      
     property = axutil_property_create_with_args(env, 0, 0, 0, "12");
     if(property)
@@ -192,7 +168,7 @@
         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);
+        payload = build_om_payload_for_echo_svc(env, echo_str);
         result = axis2_svc_client_send_receive(svc_client, env, payload);
         if(result)
         {
@@ -226,7 +202,6 @@
     }
 
     AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
-    AXIS2_FREE(env->allocator, seq_key);
 
     if(offered_seq_id)
     {
@@ -248,15 +223,3 @@
     return 0;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The" \
-        " default is amqp://127.0.0.1:5672/axis2/services/RM10SampleService \n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
-

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.c Mon Mar  8
18:48:36 2010
@@ -20,15 +20,12 @@
 axiom_node_t *
 build_om_payload_for_echo_svc(
    const axutil_env_t *env,
-   axis2_char_t *text,
-   axis2_char_t *seq)
+   axis2_char_t *text)
 {
     axiom_node_t *echo_om_node = NULL;
     axiom_element_t* echo_om_ele = NULL;
     axiom_node_t* text_om_node = NULL;
     axiom_element_t * text_om_ele = NULL;
-    axiom_node_t* seq_om_node = NULL;
-    axiom_element_t * seq_om_ele = NULL;
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *om_str = NULL;
     axis2_char_t *ns = NULL;
@@ -38,9 +35,7 @@
     ns1 = axiom_namespace_create (env, ns, "ns1");
     echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
     text_om_ele = axiom_element_create(env, echo_om_node, "Text", ns1, &text_om_node);
-    seq_om_ele = axiom_element_create(env, echo_om_node, "Sequence", ns1, &seq_om_node);
     axiom_element_set_text(text_om_ele, env, text, text_om_node);
-    axiom_element_set_text(text_om_ele, env, seq, seq_om_node);
     
     om_str = axiom_node_to_string(echo_om_node, env);
     if (om_str)

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.h?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.h (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/echo_util.h Mon Mar  8
18:48:36 2010
@@ -23,7 +23,6 @@
 axiom_node_t *
 build_om_payload_for_echo_svc(
    const axutil_env_t *env,
-   axis2_char_t *text,
-   axis2_char_t *seq);
+   axis2_char_t *text);
 
 #endif

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/rm_echo_single_1_1.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/rm_echo_single_1_1.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/rm_echo_single_1_1.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_echo_single_1_1/rm_echo_single_1_1.c Mon
Mar  8 18:48:36 2010
@@ -34,10 +34,6 @@
 
 #define SANDESHA2_SLEEP 4
 
-static void 
-usage(
-    axis2_char_t *prog_name);
-
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
@@ -51,49 +47,29 @@
     axutil_property_t *property = NULL;
     axis2_listener_manager_t *listener_manager = NULL;
     axis2_char_t *offered_seq_id = NULL;
-    axis2_char_t *seq_key = NULL;
-    int c;
     axis2_status_t status = AXIS2_FAILURE;
     axiom_node_t *result = NULL;
     neethi_policy_t *policy = NULL;
-    extern char *optarg;
-    extern int optopt; 
+    
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_single_1_1_amqp.log", AXIS2_LOG_LEVEL_TRACE);
  
 
     /* Set end point reference of echo service */
-    /*address = "http://127.0.0.1:9090/axis2/services/RM11SampleService";*/
     address = "amqp://127.0.0.1:5672/axis2/services/RM11SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
+    if (argc > 1)
     {
-
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                {
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                }
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[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 */
@@ -178,14 +154,7 @@
         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);
-    }
-    
-    payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
+    payload = build_om_payload_for_echo_svc(env, "echo1");
     /*status = axis2_svc_client_send_robust(svc_client, env, payload);
     if(status)
     {
@@ -210,7 +179,7 @@
         printf("\necho client two way single channel invoke FAILED!\n");
     }
 
-    payload = build_om_payload_for_echo_svc(env, "echo2", seq_key);
+    payload = build_om_payload_for_echo_svc(env, "echo2");
     /*status = axis2_svc_client_send_robust(svc_client, env, payload);
     if(status)
     {
@@ -235,7 +204,7 @@
         printf("\necho client two way single channel invoke FAILED!\n");
     }
 
-    payload = build_om_payload_for_echo_svc(env, "echo3", seq_key);
+    payload = build_om_payload_for_echo_svc(env, "echo3");
     /*status = axis2_svc_client_send_robust(svc_client, env, payload);
     if(status)
     {
@@ -263,7 +232,7 @@
 
     AXIS2_SLEEP(SANDESHA2_SLEEP); 
 
-    sandesha2_client_terminate_seq_with_svc_client_and_seq_key(env, svc_client, NULL, seq_key);
+    sandesha2_client_terminate_seq_with_svc_client_and_seq_key(env, svc_client, NULL, NULL);
 
     AXIS2_SLEEP(6 * SANDESHA2_SLEEP);
 
@@ -276,16 +245,4 @@
     return 0;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The" \
-        " default is amqp://127.0.0.1:5672/axis2/services/RM11SampleService \n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
-
 

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_mtom_1_0/rm_mtom_1_0.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_mtom_1_0/rm_mtom_1_0.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_mtom_1_0/rm_mtom_1_0.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_mtom_1_0/rm_mtom_1_0.c Mon Mar  8 18:48:36
2010
@@ -54,9 +54,7 @@
     axutil_property_t *property = NULL;
     axiom_node_t *result = NULL;
     axutil_string_t *soap_action = NULL;
-    int c;
     const axis2_char_t *image_name = "../../resources/axis2.jpg";
-    axis2_char_t *seq_key = NULL;
     axis2_bool_t optimized = AXIS2_TRUE;
     axis2_char_t *offered_seq_id = NULL;
     neethi_policy_t *policy = NULL;
@@ -69,29 +67,18 @@
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM10SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
+    if (argc > 1)
     {
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[1];
         }
-    }
-    if (axutil_strcmp(address, "-h") == 0)
-    {
-        printf("Usage : %s [endpoint_url]\n", argv[0]);
-        printf("use -h for help\n");
-        return 0;
     }
     printf ("Using endpoint : %s\n", address);
     
@@ -167,13 +154,6 @@
         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, 0, 0, 0, seq_key);
-    if(property)
-    {
-        axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, property);
-    }
-
     property = axutil_property_create_with_args(env, 0, 0, 0, "12");
     if(property)
     {

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_0/rm_ping_1_0.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_0/rm_ping_1_0.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_0/rm_ping_1_0.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_0/rm_ping_1_0.c Mon Mar  8 18:48:36
2010
@@ -33,10 +33,6 @@
     axis2_char_t *text,
     axis2_char_t *seq_key);
 
-static void 
-usage(
-    axis2_char_t *prog_name);
-
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
@@ -48,33 +44,25 @@
     axiom_node_t *payload = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     axutil_property_t *property = NULL;
-    int c;
     axis2_char_t *seq_key = NULL;
     neethi_policy_t *policy = NULL;
-    extern char *optarg;
-    extern int optopt; 
+    
     /* Set up the environment */
     env = axutil_env_create_all("rm_ping_1_0_amqp.log", AXIS2_LOG_LEVEL_TRACE);
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM10SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
+    if (argc > 1)
     {
-
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
         {
-            case 'a':
-                address = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
+        {
+            address = argv[1];
         }
     }
 
@@ -235,16 +223,5 @@
     return ping_om_node;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The"
-            " default is amqp://127.0.0.1:5672/axis2/services/RM10SampleService ../\n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
 
 

Modified: axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_1/rm_ping_1_1.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_1/rm_ping_1_1.c?rev=920446&r1=920445&r2=920446&view=diff
==============================================================================
--- axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_1/rm_ping_1_1.c (original)
+++ axis/axis2/c/sandesha/trunk/samples/rm_amqp/rm_ping_1_1/rm_ping_1_1.c Mon Mar  8 18:48:36
2010
@@ -31,25 +31,18 @@
 axiom_node_t *
 build_om_programatically(
     const axutil_env_t *env,
-    axis2_char_t *text,
-    const axis2_char_t *seq);
-
-static void 
-usage(
-    axis2_char_t *prog_name);
+    axis2_char_t *text);
 
 int main(int argc, char** argv)
 {
     const axutil_env_t *env = NULL;
     const axis2_char_t *address = NULL;
-    const axis2_char_t *seq_key = NULL;
     axis2_endpoint_ref_t* endpoint_ref = NULL;
     axis2_options_t *options = NULL;
     const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axutil_property_t *property = NULL;
-    int c;
     int i = 0;
     neethi_policy_t *policy = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -61,26 +54,17 @@
 
     /* Set end point reference of echo service */
     address = "amqp://127.0.0.1:5672/axis2/services/RM11SampleService";
-    while ((c = AXIS2_GETOPT(argc, argv, ":a:k:")) != -1)
+    if (argc > 1)
     {
-
-        switch (c)
+        if (axutil_strcmp(argv[1], "-h") == 0)
+        {
+            printf("Usage : %s [endpoint_url]\n", argv[0]);
+            printf("use -h for help\n");
+            return 0;
+        }
+        else
         {
-            case 'a':
-                address = optarg;
-                break;
-            case 'k': /* Sequenc Key */
-                seq_key = optarg;
-                break;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+            address = argv[1];
         }
     }
 
@@ -151,15 +135,6 @@
         axis2_options_set_property(options, env, 
             SANDESHA2_CLIENT_RM_SPEC_VERSION, property);
     }
-    if(seq_key)
-    {
-        property = axutil_property_create_with_args(env, 3, 0, 0, (void*)seq_key);
-        if(property)
-        {
-            axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, 
-                property);
-        }
-    }
 
     for(i = 1; i < 4; i++)
     {
@@ -168,7 +143,7 @@
         sprintf(echo_str, "%s%d", "echo", i);
 
         /* Send request */
-        payload = build_om_programatically(env, echo_str, seq_key);
+        payload = build_om_programatically(env, echo_str);
         status = axis2_svc_client_send_robust(svc_client, env, payload);
         if(status)
         {
@@ -201,26 +176,19 @@
 axiom_node_t *
 build_om_programatically(
     const axutil_env_t *env,
-    axis2_char_t *text,
-    const axis2_char_t *seq_key)
+    axis2_char_t *text)
 {
     axiom_node_t *ping_om_node = NULL;
     axiom_element_t* ping_om_ele = NULL;
     axiom_node_t *text_om_node = NULL;
     axiom_element_t* text_om_ele = NULL;
-    axiom_node_t* seq_om_node = NULL;
-    axiom_element_t * seq_om_ele = NULL;
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *buffer = NULL;
     
     ns1 = axiom_namespace_create (env, "http://tempuri.org/", "ns1");
     ping_om_ele = axiom_element_create(env, NULL, "ping", ns1, &ping_om_node);
     text_om_ele = axiom_element_create(env, ping_om_node, "Text", ns1, &text_om_node);
-    if(seq_key)
-        seq_om_ele = axiom_element_create(env, ping_om_node, "Sequence", ns1, &seq_om_node);
     axiom_element_set_text(text_om_ele, env, text, text_om_node);
-    if(seq_key)
-        axiom_element_set_text(text_om_ele, env, seq_key, seq_om_node);
     
     buffer = axiom_node_to_string(ping_om_node, env);
     printf("\nSending OM node in XML : %s \n",  buffer); 
@@ -228,18 +196,4 @@
     return ping_om_node;
 }
 
-static void 
-usage(
-    axis2_char_t *prog_name)
-{
-    fprintf(stdout, "\n Usage : %s", prog_name);
-    fprintf(stdout, " [-a ADDRESS]");
-    fprintf(stdout, " [-k PROVIDE SEQUENCE KEY]");
-    fprintf(stdout, " Options :\n");
-    fprintf(stdout, "\t-k PROVIDE SEQUENCE KEY \t provide the sequence key as string \n");
-    fprintf(stdout, "\t-a ADDRESS \t endpoint address.. The"
-            " default is amqp://127.0.0.1:5672/axis2/services/RM11SampleService ../\n");
-    fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
-}
-
 



Mime
View raw message