You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/09/09 13:58:36 UTC
svn commit: r441783 - in /webservices/axis2/trunk/c/samples: client/
client/echo/ client/mtom/ client/notify/ client/rm_echo/
client/rm_echo_blocking/ client/rm_ping/ server/mtom/
Author: damitha
Date: Sat Sep 9 04:58:35 2006
New Revision: 441783
URL: http://svn.apache.org/viewvc?view=rev&rev=441783
Log:
Now RM is working in following schenarios
rm_ping
rm_echo dual client non blocking
rm_echo dual client blocing
Modified:
webservices/axis2/trunk/c/samples/client/Makefile.am
webservices/axis2/trunk/c/samples/client/echo/echo.c
webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c
webservices/axis2/trunk/c/samples/client/notify/notify_client.c
webservices/axis2/trunk/c/samples/client/rm_echo/rm_echo_client.c
webservices/axis2/trunk/c/samples/client/rm_echo_blocking/rm_echo_blocking.c
webservices/axis2/trunk/c/samples/client/rm_ping/rm_ping_client.c
webservices/axis2/trunk/c/samples/server/mtom/services.xml
Modified: webservices/axis2/trunk/c/samples/client/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/Makefile.am?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/client/Makefile.am Sat Sep 9 04:58:35 2006
@@ -1,4 +1,4 @@
clientdir=$(prefix)/samples/client
-SUBDIRS = echo math google notify mtom dynamic_client rm_ping rm_echo
+SUBDIRS = echo math google notify mtom dynamic_client rm_ping rm_echo rm_echo_blocking
client_DATA = Makefile.am Makefile.in
EXTRA_DIST= Makefile.am
Modified: webservices/axis2/trunk/c/samples/client/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/echo/echo.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/echo/echo.c (original)
+++ webservices/axis2/trunk/c/samples/client/echo/echo.c Sat Sep 9 04:58:35 2006
@@ -107,7 +107,26 @@
AXIS2_ERROR_GET_MESSAGE(env->error));
printf("echo client invoke FAILED!\n");
}
+ payload = build_om_payload_for_echo_svc(env);
+ /* Send request */
+ ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+
+ if(ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = AXIOM_NODE_TO_STRING(ret_node, env);
+ if (om_str)
+ printf("\nReceived OM : %s\n", om_str);
+ printf("\necho 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("echo client invoke FAILED!\n");
+ }
if (svc_client)
{
AXIS2_SVC_CLIENT_FREE(svc_client, env);
Modified: webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c Sat Sep 9 04:58:35 2006
@@ -37,6 +37,8 @@
axiom_node_t *ret_node = NULL;
const axis2_char_t *image_name = "resources/axis2.jpg";
const axis2_char_t *to_save_name = "test.jpg";
+ axis2_property_t *property = NULL;
+ axis2_endpoint_ref_t* reply_to = NULL;
/* Set up the environment */
@@ -61,10 +63,21 @@
/* Create EPR with given address */
endpoint_ref = axis2_endpoint_ref_create(env, address);
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
+ AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_VALUE_TRUE);
/* Setup options */
options = axis2_options_create(env);
AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
+ AXIS2_OPTIONS_SET_USE_SEPARATE_LISTENER(options, env, AXIS2_TRUE);
+ /* Seperate listner needs addressing, hence addressing stuff in options */
+ AXIS2_OPTIONS_SET_ACTION(options, env,
+ "http://ws.apache.org/axis2/c/samples/mtomSample");
+ reply_to = axis2_endpoint_ref_create(env,
+ "http://localhost:6060/axis2/services/__ANONYMOUS_SERVICE__/__OPERATION_OUT_IN__");
+
+ AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);
AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP11);
AXIS2_OPTIONS_SET_ENABLE_MTOM(options, env, AXIS2_TRUE);
@@ -94,10 +107,13 @@
/* Engage addressing module */
AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, AXIS2_MODULE_ADDRESSING);
+ AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, "sandesha2");
/* Build the SOAP request message payload using OM API.*/
payload = build_om_programatically(env, image_name, to_save_name);
+ AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage",
+ property);
/* Send request */
ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
Modified: webservices/axis2/trunk/c/samples/client/notify/notify_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/notify/notify_client.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/notify/notify_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/notify/notify_client.c Sat Sep 9 04:58:35 2006
@@ -102,6 +102,21 @@
AXIS2_ERROR_GET_MESSAGE(env->error));
printf("notify client invoke FAILED!\n");
}
+
+ payload = build_om_programatically(env);
+ /* Send request */
+ status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
+ if(status == AXIS2_SUCCESS)
+ {
+ printf("\nnotify 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("notify client invoke FAILED!\n");
+ }
if (svc_client)
{
Modified: webservices/axis2/trunk/c/samples/client/rm_echo/rm_echo_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/rm_echo/rm_echo_client.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/rm_echo/rm_echo_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/rm_echo/rm_echo_client.c Sat Sep 9 04:58:35 2006
@@ -113,38 +113,32 @@
AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, "sandesha2");
/* Build the SOAP request message payload using OM API.*/
- payload = build_om_payload_for_echo_svc(env);
+ /*payload = build_om_payload_for_echo_svc(env);
- /* Create the callback object with default on_complete and on_error
- callback functions */
callback1 = axis2_callback_create(env);
- /* Set our on_complete fucntion pointer to the callback object */
AXIS2_CALLBACK_SET_ON_COMPLETE(callback1, rm_echo_callback_on_complete);
- /* Set our on_error function pointer to the callback object */
AXIS2_CALLBACK_SET_ON_ERROR(callback1, rm_echo_callback_on_error);
- AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage",
- property);
- /* Send request */
AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING(svc_client, env,
payload, callback1);
- /*
- op_qname = axis2_qname_create(env, "echoString", NULL, NULL);
- AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING_WITH_OP_QNAME(svc_client,
- env, op_qname, payload, callback1);
- */
- /*callback2 = axis2_callback_create(env);
+ AXIS2_SLEEP(5);*/
+ /* Create the callback object with default on_complete and on_error
+ callback functions */
+ callback2 = axis2_callback_create(env);
+ /* Set our on_complete fucntion pointer to the callback object */
AXIS2_CALLBACK_SET_ON_COMPLETE(callback2, rm_echo_callback_on_complete);
+ /* Set our on_error function pointer to the callback object */
AXIS2_CALLBACK_SET_ON_ERROR(callback2, rm_echo_callback_on_error);
payload = build_om_payload_for_echo_svc(env);
AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage",
property);
+ /* Send request */
AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING(svc_client, env,
payload, callback2);
- */
+
/** Wait till callback is complete. Simply keep the parent thread running
until our on_complete or on_error is invoked */
while(count < MAX_COUNT )
Modified: webservices/axis2/trunk/c/samples/client/rm_echo_blocking/rm_echo_blocking.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/rm_echo_blocking/rm_echo_blocking.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/rm_echo_blocking/rm_echo_blocking.c (original)
+++ webservices/axis2/trunk/c/samples/client/rm_echo_blocking/rm_echo_blocking.c Sat Sep 9 04:58:35 2006
@@ -101,10 +101,9 @@
AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, "sandesha2");
/* Build the SOAP request message payload using OM API.*/
- payload = build_om_payload_for_echo_svc(env, "echo1");
- /* Send request */
+ /*payload = build_om_payload_for_echo_svc(env, "echo1");
AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
- AXIS2_SLEEP(2);
+ AXIS2_SLEEP(2);*/
/* Build the SOAP request message payload using OM API.*/
payload2 = build_om_payload_for_echo_svc(env, "echo2");
Modified: webservices/axis2/trunk/c/samples/client/rm_ping/rm_ping_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/rm_ping/rm_ping_client.c?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/client/rm_ping/rm_ping_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/rm_ping/rm_ping_client.c Sat Sep 9 04:58:35 2006
@@ -21,7 +21,9 @@
#include <axis2_client.h>
axiom_node_t *
-build_om_programatically(const axis2_env_t *env);
+build_om_programatically(
+ const axis2_env_t *env,
+ axis2_char_t *text);
int main(int argc, char** argv)
{
@@ -88,16 +90,29 @@
AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, AXIS2_MODULE_ADDRESSING);
/* Build the SOAP request message payload using OM API.*/
- payload = build_om_programatically(env);
AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, "sandesha2");
-
+
+ /* 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_SLEEP(2);*/
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_VALUE_TRUE);
AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage",
property);
-
- /* Send request */
+ payload = build_om_programatically(env, "ping2");
status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
if(status == AXIS2_SUCCESS)
{
@@ -110,7 +125,7 @@
AXIS2_ERROR_GET_MESSAGE(env->error));
printf("ping client invoke FAILED!\n");
}
- AXIS2_SLEEP(1000);
+ AXIS2_SLEEP(10);
if (svc_client)
{
@@ -127,7 +142,9 @@
/* build SOAP request message content using OM */
axiom_node_t *
-build_om_programatically(const axis2_env_t *env)
+build_om_programatically(
+ const axis2_env_t *env,
+ axis2_char_t *text)
{
axiom_node_t *ping_om_node = NULL;
axiom_element_t* ping_om_ele = NULL;
@@ -136,7 +153,7 @@
ns1 = axiom_namespace_create (env, "http://example.org/rm_ping", "m");
ping_om_ele = axiom_element_create(env, NULL, "ping", ns1, &ping_om_node);
- AXIOM_ELEMENT_SET_TEXT(ping_om_ele, env, "ping5", ping_om_node);
+ AXIOM_ELEMENT_SET_TEXT(ping_om_ele, env, text, ping_om_node);
buffer = AXIOM_NODE_TO_STRING(ping_om_node, env);
printf("\nSending OM node in XML : %s \n", buffer);
Modified: webservices/axis2/trunk/c/samples/server/mtom/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/mtom/services.xml?view=diff&rev=441783&r1=441782&r2=441783
==============================================================================
--- webservices/axis2/trunk/c/samples/server/mtom/services.xml (original)
+++ webservices/axis2/trunk/c/samples/server/mtom/services.xml Sat Sep 9 04:58:35 2006
@@ -1,4 +1,5 @@
<service name="mtom">
+ <module ref="sandesha2"/>
<parameter name="ServiceClass" locked="xsd:false">mtom</parameter>
<description>
@@ -6,6 +7,7 @@
</description>
<operation name="mtomSample">
+ <parameter name="wsamapping" >http://ws.apache.org/axis2/c/samples/mtom</parameter>
</operation>
</service>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org