Author: damitha
Date: Wed Feb 6 20:14:11 2008
New Revision: 619254
URL: http://svn.apache.org/viewvc?rev=619254&view=rev
Log:
Updating the sample to work with new changes
Modified:
webservices/sandesha/trunk/c/samples/rm_report/report.c
Modified: webservices/sandesha/trunk/c/samples/rm_report/report.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_report/report.c?rev=619254&r1=619253&r2=619254&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_report/report.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_report/report.c Wed Feb 6 20:14:11
2008
@@ -34,23 +34,6 @@
#define SANDESHA2_MAX_COUNT 4
-/* on_complete callback function */
-axis2_status_t AXIS2_CALL
-rm_report_callback_on_complete(
- struct axis2_callback *callback,
- const axutil_env_t *env);
-
-/* on_error callback function */
-axis2_status_t AXIS2_CALL
-rm_report_callback_on_error(
- struct axis2_callback *callback,
- const axutil_env_t *env,
- int exception);
-
-void wait_on_callback(
- const axutil_env_t *env,
- axis2_callback_t *callback);
-
static void
usage(
axis2_char_t *prog_name);
@@ -76,15 +59,10 @@
int c;
/* Set up the environment */
- /*env = axutil_env_create_all("report_non_blocking_dual.log",
- AXIS2_LOG_LEVEL_DEBUG);*/
- /*env = axutil_env_create_all("report_non_blocking_dual.log",
- AXIS2_LOG_LEVEL_ERROR);*/
env = axutil_env_create_all("rm_report.log",
AXIS2_LOG_LEVEL_DEBUG);
/* Set end point reference of report service */
- /*address = "http://127.0.0.1:9090/axis2/services/RMSampleService";*/
address = "http://127.0.0.1:9090/axis2/services/RMSampleService";
while ((c = AXIS2_GETOPT(argc, argv, ":a:")) != -1)
{
@@ -143,12 +121,11 @@
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;
}
-
/* Set service client options */
axis2_svc_client_set_options(svc_client, env, options);
@@ -277,87 +254,11 @@
AXIS2_FREE(env->allocator, seq_key);
if (svc_client)
{
- /*axis2_svc_client_free(svc_client, env);*/
+ axis2_svc_client_free(svc_client, env);
svc_client = NULL;
}
return 0;
-}
-
-axis2_status_t AXIS2_CALL
-rm_report_callback_on_complete(
- struct axis2_callback *callback,
- const axutil_env_t *env)
-{
- /** SOAP response has arrived here; get the soap envelope
- from the callback object and do whatever you want to do with it */
-
- axiom_soap_envelope_t *soap_envelope = NULL;
- axiom_node_t *ret_node = NULL;
- axis2_status_t status = AXIS2_SUCCESS;
-
- soap_envelope = axis2_callback_get_envelope(callback, env);
-
- if (!soap_envelope)
- {
- 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("report stub invoke FAILED!\n");
- status = AXIS2_FAILURE;
- }
- else
- {
- ret_node = axiom_soap_envelope_get_base_node(soap_envelope, env);
-
- if(!ret_node)
- {
- 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("report stub invoke FAILED!\n");
- status = AXIS2_FAILURE;
- }
- else
- {
- 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("\nreport client invoke SUCCESSFUL!\n");
- }
- }
- return status;
-}
-
-axis2_status_t AXIS2_CALL
-rm_report_callback_on_error(
- struct axis2_callback *callback,
- const axutil_env_t *env,
- int exception)
-{
- /** take necessary action on error */
- printf("\nEcho client invoke FAILED. Error code:%d ::%s", exception,
- AXIS2_ERROR_GET_MESSAGE(env->error));
- return AXIS2_SUCCESS;
-}
-
-void wait_on_callback(
- const axutil_env_t *env,
- axis2_callback_t *callback)
-{
- /** Wait till callback is complete. Simply keep the parent thread running
- until our on_complete or on_error is invoked */
- while(1)
- {
- if (axis2_callback_get_complete(callback, env))
- {
- /* We are done with the callback */
- break;
- }
- }
- return;
}
static void
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]