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 sh...@apache.org on 2009/09/28 15:43:03 UTC

svn commit: r819536 - in /webservices/axis2/trunk/c/src/core/clientapi: callback.c op_client.c svc_client.c

Author: shankar
Date: Mon Sep 28 13:43:02 2009
New Revision: 819536

URL: http://svn.apache.org/viewvc?rev=819536&view=rev
Log:
Getting msg context for dual channel

Modified:
    webservices/axis2/trunk/c/src/core/clientapi/callback.c
    webservices/axis2/trunk/c/src/core/clientapi/op_client.c
    webservices/axis2/trunk/c/src/core/clientapi/svc_client.c

Modified: webservices/axis2/trunk/c/src/core/clientapi/callback.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/callback.c?rev=819536&r1=819535&r2=819536&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/callback.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/callback.c Mon Sep 28 13:43:02 2009
@@ -28,6 +28,9 @@
     /** envelope corresponding to the result */
     axiom_soap_envelope_t *envelope;
 
+    /** message context corresponding to the result */
+    axis2_msg_ctx_t *msg_ctx;
+
     /** error code */
     int error;
 
@@ -94,6 +97,7 @@
 
     callback->complete = AXIS2_FALSE;
     callback->envelope = NULL;
+    callback->msg_ctx = NULL;
     callback->error = AXIS2_ERROR_NONE;
     callback->data = NULL;
     callback->mutex = NULL;
@@ -112,7 +116,11 @@
 {
     axis2_status_t status = AXIS2_FAILURE;
 
-    axis2_callback_set_envelope(callback, env, axis2_async_result_get_envelope(result, env));
+    callback->envelope = axis2_async_result_get_envelope(result, env);
+    callback->msg_ctx = axis2_async_result_get_result(result, env);
+    axis2_msg_ctx_increment_ref(callback->msg_ctx, env); /* this will be set in opclient's msgctx
+                                                            map and will be deleted from there */
+
     status = callback->on_complete(callback, env);
 
     return status;
@@ -164,6 +172,24 @@
     return AXIS2_SUCCESS;
 }
 
+AXIS2_EXTERN axis2_msg_ctx_t *AXIS2_CALL
+axis2_callback_get_msg_ctx(
+    const axis2_callback_t * callback,
+    const axutil_env_t * env)
+{
+    return callback->msg_ctx;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_callback_set_msg_ctx(
+    axis2_callback_t * callback,
+    const axutil_env_t * env,
+    axis2_msg_ctx_t * msg_ctx)
+{
+    callback->msg_ctx = msg_ctx;
+    return AXIS2_SUCCESS;
+}
+
 AXIS2_EXTERN int AXIS2_CALL
 axis2_callback_get_error(
     const axis2_callback_t * callback,

Modified: webservices/axis2/trunk/c/src/core/clientapi/op_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/op_client.c?rev=819536&r1=819535&r2=819536&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/op_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/op_client.c Mon Sep 28 13:43:02 2009
@@ -290,11 +290,34 @@
 
     msg_ctx_map = axis2_op_ctx_get_msg_ctx_map(op_client->op_ctx, env);
 
+    if(msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT])
+    {
+        axis2_msg_ctx_free(msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT], env);
+    }
     msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT] = mc;
 
     return AXIS2_SUCCESS;
 }
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_op_client_add_in_msg_ctx(
+    axis2_op_client_t * op_client,
+    const axutil_env_t * env,
+    axis2_msg_ctx_t * mc)
+{
+    axis2_msg_ctx_t **msg_ctx_map = NULL;
+
+    msg_ctx_map = axis2_op_ctx_get_msg_ctx_map(op_client->op_ctx, env);
+
+    if(msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN])
+    {
+        axis2_msg_ctx_free(msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN], env);
+    }
+    msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN] = mc;
+
+    return AXIS2_SUCCESS;
+}
+
 AXIS2_EXTERN const axis2_msg_ctx_t *AXIS2_CALL
 axis2_op_client_get_msg_ctx(
     const axis2_op_client_t * op_client,

Modified: webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/svc_client.c?rev=819536&r1=819535&r2=819536&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/svc_client.c Mon Sep 28 13:43:02 2009
@@ -664,16 +664,18 @@
         }
 
         soap_envelope = axis2_callback_get_envelope(callback, env);
+        msg_ctx = axis2_callback_get_msg_ctx(callback, env);
+        axis2_op_client_add_in_msg_ctx(svc_client->op_client, env, msg_ctx);
 
         /* start of hack to get rid of memory leak */
-        msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client-> svc_ctx, env),
+        /*msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client-> svc_ctx, env),
             NULL, NULL);
         if(!msg_ctx)
             return NULL;
 
-        axis2_op_client_add_msg_ctx(svc_client->op_client, env, msg_ctx);
+        axis2_op_client_add_in_msg_ctx(svc_client->op_client, env, msg_ctx);
 
-        axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+        axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);*/
         /* end of hack to get rid of memory leak */
 
         /* process the result of the invocation */