You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by da...@apache.org on 2007/02/26 09:57:08 UTC

svn commit: r511757 - in /webservices/sandesha/trunk/c: include/ samples/rm_echo_single_1_0/ samples/rm_mtom_1_0/ src/client/ src/handlers/ src/msgprocessors/ src/storage/ src/storage/permanent/ src/workers/

Author: damitha
Date: Mon Feb 26 00:57:07 2007
New Revision: 511757

URL: http://svn.apache.org/viewvc?view=rev&rev=511757
Log:
Please refer to Sandesha2c-26

Modified:
    webservices/sandesha/trunk/c/include/sandesha2_client.h
    webservices/sandesha/trunk/c/include/sandesha2_permanent_bean_mgr.h
    webservices/sandesha/trunk/c/include/sandesha2_permanent_storage_mgr.h
    webservices/sandesha/trunk/c/include/sandesha2_storage_mgr.h
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
    webservices/sandesha/trunk/c/samples/rm_mtom_1_0/Makefile.am
    webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_bean_mgr.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/storage/storage_mgr.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: webservices/sandesha/trunk/c/include/sandesha2_client.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_client.h?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_client.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_client.h Mon Feb 26 00:57:07 2007
@@ -212,6 +212,22 @@
     axiom_node_t *payload,
     axis2_listener_manager_t *listener_manager);
 
+/**
+ * In RM 1.0 two way single channel messaging user need
+ * to call for the response envelope.
+ *
+ * @param conf_ctx
+ * @param svc_client
+ * @param msg_no
+ * @return response soap envelope
+ */
+axiom_node_t *AXIS2_CALL
+sandesha2_client_get_response_envelope(
+    const axis2_env_t *env,
+    axis2_conf_ctx_t *conf_ctx,
+    axis2_svc_client_t *svc_client,
+    int msg_no);
+
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/sandesha/trunk/c/include/sandesha2_permanent_bean_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_permanent_bean_mgr.h?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_permanent_bean_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_permanent_bean_mgr.h Mon Feb 26 00:57:07 2007
@@ -42,6 +42,7 @@
 typedef struct sandesha2_permanent_bean_mgr_ops sandesha2_permanent_bean_mgr_ops_t;
 struct sandesha2_storage_mgr;
 struct axis2_conf_ctx;
+struct sandesha2_response;
 
 AXIS2_DECLARE_DATA struct sandesha2_permanent_bean_mgr_ops
 {
@@ -166,6 +167,29 @@
     sandesha2_permanent_bean_mgr_t *bean_mgr,
     const axis2_env_t *env,
     axis2_char_t *key);
+
+axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_store_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axis2_char_t *response,
+    int msg_no,
+    int soap_version);
+
+axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_remove_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    int msg_no);
+
+struct sandesha2_response *AXIS2_CALL
+sandesha2_permanent_bean_mgr_retrieve_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    int msg_no);
 
 int
 sandesha2_permanent_bean_mgr_busy_handler(

Modified: webservices/sandesha/trunk/c/include/sandesha2_permanent_storage_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_permanent_storage_mgr.h?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_permanent_storage_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_permanent_storage_mgr.h Mon Feb 26 00:57:07 2007
@@ -33,6 +33,11 @@
 {
 #endif
 
+typedef struct sandesha2_response
+{
+    int soap_version;
+    axis2_char_t *response_str;
+} sandesha2_response_t;
 
 /** 
  * @ingroup sandesha2_storage

Modified: webservices/sandesha/trunk/c/include/sandesha2_storage_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_storage_mgr.h?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_storage_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_storage_mgr.h Mon Feb 26 00:57:07 2007
@@ -163,6 +163,29 @@
                 axiom_soap_envelope_t *soap_env,
                 axis2_char_t *key);
 	
+    axis2_status_t (AXIS2_CALL *
+            store_response) (
+                sandesha2_storage_mgr_t *storage_mgr,
+                const axis2_env_t *env,
+                axis2_char_t *seq_id,
+                axiom_soap_envelope_t *response,
+                int msg_no,
+                int soap_version);
+
+    axiom_soap_envelope_t * (AXIS2_CALL *
+            retrieve_response) (
+                sandesha2_storage_mgr_t *storage_mgr, 
+                const axis2_env_t *env, 
+                axis2_char_t *seq_id,
+                int msg_no);
+
+    axis2_status_t (AXIS2_CALL *
+            remove_response) (
+                sandesha2_storage_mgr_t *storage_mgr, 
+                const axis2_env_t *env, 
+                axis2_char_t *seq_id,
+                int msg_no);
+
 };
 
 AXIS2_DECLARE_DATA struct sandesha2_storage_mgr
@@ -315,6 +338,28 @@
     axiom_soap_envelope_t *soap_env,
     axis2_char_t *key);
 
+axis2_status_t AXIS2_CALL
+sandesha2_storage_mgr_store_response(
+    sandesha2_storage_mgr_t *storage_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axiom_soap_envelope_t *response,
+    int msg_no,
+    int soap_version);
+
+axiom_soap_envelope_t * AXIS2_CALL
+sandesha2_storage_mgr_retrieve_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no);
+
+axis2_status_t AXIS2_CALL
+sandesha2_storage_mgr_remove_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no);
                        
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c Mon Feb 26 00:57:07 2007
@@ -62,12 +62,15 @@
     axis2_options_t *options = NULL;
     const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
+    axis2_svc_ctx_t *svc_ctx = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
     axiom_node_t *payload = NULL;
     axis2_property_t *property = NULL;
     axis2_listener_manager_t *listener_manager = NULL;
     axis2_char_t *offered_seq_id = NULL;
-    axiom_node_t *result = NULL;
+    axiom_soap_envelope_t *result = NULL;
     int c;
+    int i = 0, size = 0;
    
     /* Set up the environment */
     /*env = axis2_env_create_all("echo_non_blocking_dual.log", 
@@ -117,6 +120,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");
+    AXIS2_OPTIONS_SET_TIMEOUT_IN_MILLI_SECONDS(options, env, 8000000);
     reply_to = axis2_endpoint_ref_create(env, AXIS2_WSA_ANONYMOUS_URL);
     /*AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);*/
 
@@ -178,10 +182,14 @@
         AXIS2_OPTIONS_SET_PROPERTY(options, env, SANDESHA2_CLIENT_SEQ_KEY, 
             property);
     }
-    
-    /*payload = build_om_payload_for_echo_svc(env, "echo1", "sequence1");
+     
+    payload = build_om_payload_for_echo_svc(env, "echo1", "sequence1");
     result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
-        printf("\necho client single channel invoke SUCCESSFUL!\n");
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
+
+    /*svc_ctx = AXIS2_SVC_CLIENT_GET_SVC_CTX(svc_client, env);
+    conf_ctx = axis2_svc_ctx_get_conf_ctx(svc_ctx, env);
+    result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 1);*/
     if(result)
     {
         axis2_char_t *om_str = NULL;
@@ -198,12 +206,12 @@
         printf("\necho client two way single channel invoke FAILED!\n");
     }
     payload = NULL;
-    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
-
+   
     payload = build_om_payload_for_echo_svc(env, "echo2", "sequence1");
     result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
-    if(result)
-        printf("\necho client single channel invoke SUCCESSFUL!\n");
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
+
+    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 2);*/
     if(result)
     {
         axis2_char_t *om_str = NULL;
@@ -220,12 +228,13 @@
         printf("\necho client two way single channel invoke FAILED!\n");
     }
     payload = NULL;
-    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
-    */
+
     property = axis2_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
     AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage", property);
     payload = build_om_payload_for_echo_svc(env, "echo3", "sequence1");
     result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT);
+    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 3);*/
     if(result)
     {
         axis2_char_t *om_str = NULL;
@@ -242,8 +251,8 @@
         printf("\necho client two way single channel invoke FAILED!\n");
     }
     payload = NULL;
+    AXIS2_SLEEP(2 * SANDESHA2_MAX_COUNT);
 
-    AXIS2_SLEEP(3 * SANDESHA2_MAX_COUNT);
     if (svc_client)
     {
         /*AXIS2_SVC_CLIENT_FREE(svc_client, env);*/

Modified: webservices/sandesha/trunk/c/samples/rm_mtom_1_0/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_mtom_1_0/Makefile.am?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_mtom_1_0/Makefile.am (original)
+++ webservices/sandesha/trunk/c/samples/rm_mtom_1_0/Makefile.am Mon Feb 26 00:57:07 2007
@@ -13,6 +13,9 @@
                     -lpthread \
                     -laxis2_http_sender \
                     -laxis2_http_receiver \
+                    -L$(AXIS2C_HOME)/modules/sandesha2 \
+					-lsandesha2_client \
+					-lsandesha2 \
 					-lsqlite3 \
                     $(GUTHTHILA_LIBS) \
                     $(LIBXML2_LIBS)

Modified: webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c Mon Feb 26 00:57:07 2007
@@ -24,10 +24,11 @@
 #include <axis2_listener_manager.h>
 #include <axis2_callback_recv.h>
 #include <axis2_svc_client.h>
+#include <sandesha2_client.h>
 #include <sandesha2_client_constants.h>
 #include <ctype.h>
 
-#define SANDESHA2_SLEEP_TIME 2
+#define SANDESHA2_MAX_COUNT 4
 void 
 usage(
     axis2_char_t *prog_name);
@@ -39,11 +40,14 @@
     axis2_endpoint_ref_t* endpoint_ref = NULL;
     axis2_options_t *options = NULL;
     const axis2_char_t *client_home = NULL;
+    axis2_svc_ctx_t *svc_ctx = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axis2_property_t *property = NULL;
     axis2_char_t *offered_seq_id = NULL;
     axis2_status_t status = AXIS2_FAILURE;
+    axiom_soap_envelope_t *result = NULL;
     int c;
     const axis2_char_t *image_name = "resources/axis2.jpg";
    
@@ -127,26 +131,72 @@
     if(property)
         AXIS2_OPTIONS_SET_PROPERTY(options, env, SANDESHA2_CLIENT_OFFERED_SEQ_ID,
             property);
+    svc_ctx = AXIS2_SVC_CLIENT_GET_SVC_CTX(svc_client, env);
+    conf_ctx = axis2_svc_ctx_get_conf_ctx(svc_ctx, env);
     payload = build_om_payload_for_mtom(env, image_name, "test1.jpg");
-    status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
-    if(status)
-        printf("\nmtom  invoke SUCCESSFUL!\n");
-    AXIS2_SLEEP(SANDESHA2_SLEEP_TIME); 
+    AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
+    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 1);
+    if(result)
+    {
+        axis2_char_t *om_str = NULL;
+        om_str = AXIOM_NODE_TO_STRING(result, env);
+        if (om_str)
+            printf("\nReceived OM : %s\n", om_str);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
+    }*/
 
     payload = build_om_payload_for_mtom(env, image_name, "test2.jpg");
-    status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
-    if(status)
-        printf("\nmtom  invoke SUCCESSFUL!\n");
-    AXIS2_SLEEP(SANDESHA2_SLEEP_TIME); 
+    AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
+    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 1);
+    if(result)
+    {
+        axis2_char_t *om_str = NULL;
+        om_str = AXIOM_NODE_TO_STRING(result, env);
+        if (om_str)
+            printf("\nReceived OM : %s\n", om_str);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
+    }*/
 
     payload = build_om_payload_for_mtom(env, image_name, "test3.jpg");
     property = axis2_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
     AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage", 
         property);
-    status = AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload);
-    if(status)
-        printf("\nmtom  invoke SUCCESSFUL!\n");
-    AXIS2_SLEEP(3 * SANDESHA2_SLEEP_TIME); 
+    AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
+    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 1);
+    if(result)
+    {
+        axis2_char_t *om_str = NULL;
+        om_str = AXIOM_NODE_TO_STRING(result, env);
+        if (om_str)
+            printf("\nReceived OM : %s\n", om_str);
+        printf("\necho client two way single channel invoke SUCCESSFUL!\n");
+
+        AXIS2_FREE(env->allocator, om_str);
+        result = NULL;
+    }
+    else
+    {
+        printf("\necho client two way single channel invoke FAILED!\n");
+    }*/
+
+    AXIS2_SLEEP(SANDESHA2_MAX_COUNT); 
     if (svc_client)
     {
         /*AXIS2_SVC_CLIENT_FREE(svc_client, env);*/

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Mon Feb 26 00:57:07 2007
@@ -174,7 +174,7 @@
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
                 "To address is not set.");
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
         SANDESHA2_CLIENT_SEQ_KEY);
     seq_key = axis2_property_get_value(property, env);
@@ -250,12 +250,12 @@
     seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env); 
     create_seq_mgr = sandesha2_storage_mgr_get_create_seq_mgr(storage_mgr, env); 
     ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
-    property = AXIS2_CTX_GET_PROPERTY(ctx, env, SANDESHA2_WITHIN_TRANSACTION, 
+    property = axis2_ctx_get_property(ctx, env, SANDESHA2_WITHIN_TRANSACTION, 
         AXIS2_FALSE);
     if(property)
         within_transaction_str = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE(
             property, env);
-    if(within_transaction_str && 0 == AXIS2_STRCMP(within_transaction_str, 
+    if(within_transaction_str && 0 == axis2_strcmp(within_transaction_str, 
         SANDESHA2_VALUE_TRUE))
     {
         within_transaction = AXIS2_TRUE;
@@ -407,12 +407,12 @@
     sandesha2_report = sandesha2_report_create(env);
     internal_seq_find_bean = sandesha2_seq_property_bean_create(env);
     ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
-    property = (axis2_property_t *) AXIS2_CTX_GET_PROPERTY(ctx, env, 
+    property = (axis2_property_t *) axis2_ctx_get_property(ctx, env, 
             SANDESHA2_WITHIN_TRANSACTION, AXIS2_FALSE);
     if(property)
         within_transaction_str = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE(
             property, env);
-    if(within_transaction_str && 0 == AXIS2_STRCMP(within_transaction_str, 
+    if(within_transaction_str && 0 == axis2_strcmp(within_transaction_str, 
                 SANDESHA2_VALUE_TRUE))
     {
         within_transaction = AXIS2_TRUE;
@@ -440,7 +440,7 @@
         return sandesha2_report;
     }
     if(collection)
-        size = AXIS2_ARRAY_LIST_SIZE(collection, env);
+        size = axis2_array_list_size(collection, env);
     for(i = 0; i < size; i++)
     {
         sandesha2_seq_property_bean_t *bean = NULL;
@@ -462,7 +462,7 @@
                 env, value, conf_ctx);
         completed_msgs = SANDESHA2_SEQ_REPORT_GET_COMPLETED_MSGS(report, env);
         if(completed_msgs)
-            no_of_msgs = AXIS2_ARRAY_LIST_SIZE(completed_msgs, env);
+            no_of_msgs = axis2_array_list_size(completed_msgs, env);
         SANDESHA2_REPORT_ADD_TO_NO_OF_COMPLETED_MSGS_MAP(sandesha2_report, env, 
                 seq_id, no_of_msgs);
         status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(report, env);
@@ -472,9 +472,9 @@
     svr_completed_msgs_find_bean = sandesha2_seq_property_bean_create(env);
     if(svr_completed_msgs_find_bean)
         sandesha2_seq_property_bean_set_name(svr_completed_msgs_find_bean, env, 
-                SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
+            SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
     svr_completed_msgs_beans = sandesha2_seq_property_mgr_find(seq_prop_mgr, 
-            env, svr_completed_msgs_find_bean);
+        env, svr_completed_msgs_find_bean);
     if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
     {
         if(AXIS2_TRUE != within_transaction && report_transaction != NULL)
@@ -490,7 +490,7 @@
         return sandesha2_report;
     }
     if(svr_completed_msgs_beans)
-        size = AXIS2_ARRAY_LIST_SIZE(svr_completed_msgs_beans, env);
+        size = axis2_array_list_size(svr_completed_msgs_beans, env);
     for(i = 0; i < size; i++)
     {
         sandesha2_seq_property_bean_t *svr_completed_msgs_bean = NULL;
@@ -504,22 +504,22 @@
         svr_completed_msgs_bean = (sandesha2_seq_property_bean_t *) 
             AXIS2_ARRAY_LIST_GET(svr_completed_msgs_beans, env, i);
         seq_id = sandesha2_seq_property_bean_get_seq_id(svr_completed_msgs_bean, 
-                env);
+            env);
         SANDESHA2_REPORT_ADD_TO_INCOMING_SEQ_LIST(sandesha2_report, env, seq_id);
         value = sandesha2_seq_property_bean_get_value(svr_completed_msgs_bean, 
-                env);
+            env);
         seq_report = sandesha2_client_get_incoming_seq_report(env, value, 
-                conf_ctx);
+            conf_ctx);
         completed_msgs = SANDESHA2_SEQ_REPORT_GET_COMPLETED_MSGS(seq_report, env);
         if(completed_msgs)
-            no_of_msgs = AXIS2_ARRAY_LIST_SIZE(completed_msgs, env);
+            no_of_msgs = axis2_array_list_size(completed_msgs, env);
         SANDESHA2_REPORT_ADD_TO_NO_OF_COMPLETED_MSGS_MAP(sandesha2_report, env, 
-                seq_id, no_of_msgs);
+            seq_id, no_of_msgs);
         status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
         SANDESHA2_REPORT_ADD_TO_SEQ_STATUS_MAP(sandesha2_report, env, seq_id, status);
     }
     if (AXIS2_TRUE != within_transaction && AXIS2_TRUE != rolled_back && 
-                report_transaction != NULL) 
+        report_transaction != NULL) 
     {
         sandesha2_transaction_commit(report_transaction, env);
     }
@@ -552,7 +552,7 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     if(!to)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_EPR_NOT_SET, AXIS2_FAILURE);
@@ -830,7 +830,7 @@
     }
     spec_version = (axis2_char_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
             SANDESHA2_CLIENT_RM_SPEC_VERSION);
-    if(0 != AXIS2_STRCMP(SANDESHA2_SPEC_VERSION_1_1, spec_version))
+    if(0 != axis2_strcmp(SANDESHA2_SPEC_VERSION_1_1, spec_version))
     {
         AXIS2_ERROR_SET(env->error, 
                 SANDESHA2_ERROR_CLOSE_SEQ_FEATURE_ONLY_AVAILABLE_FOR_WSRM1_1, 
@@ -950,10 +950,10 @@
         return AXIS2_FAILURE;
     }
     old_property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
-            SANDESHA2_CLIENT_SEQ_KEY);
+        SANDESHA2_CLIENT_SEQ_KEY);
     AXIS2_OPTIONS_SET_PROPERTY(options, env, SANDESHA2_CLIENT_SEQ_KEY, property);
     sandesha2_client_wait_until_seq_completed_with_svc_client_and_max_waiting_time(
-            env, svc_client, max_waiting_time);
+        env, svc_client, max_waiting_time);
     AXIS2_OPTIONS_SET_PROPERTY(options, env, SANDESHA2_CLIENT_SEQ_KEY, old_property);
     return AXIS2_SUCCESS;
 }
@@ -996,9 +996,9 @@
                 AXIS2_FAILURE);
         return NULL;
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
-            SANDESHA2_CLIENT_SEQ_KEY);
+        SANDESHA2_CLIENT_SEQ_KEY);
     seq_key = axis2_property_get_value(property, env);
    svc_ctx = (axis2_svc_ctx_t *) AXIS2_SVC_CLIENT_GET_SVC_CTX(svc_client, env);
    if(!svc_ctx)
@@ -1091,19 +1091,19 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
-            SANDESHA2_CLIENT_SEQ_KEY);
+        SANDESHA2_CLIENT_SEQ_KEY);
     seq_key = axis2_property_get_value(property, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
-            SANDESHA2_CLIENT_RM_SPEC_VERSION);
+        SANDESHA2_CLIENT_RM_SPEC_VERSION);
     if(property)
         rm_spec_version = AXIS2_PROPERTY_GET_VALUE(property, env);
     if(!rm_spec_version)
     {
         rm_spec_version = AXIS2_STRDUP(SANDESHA2_SPEC_VERSION_1_0, env); 
     }
-    if(0  == AXIS2_STRCMP(rm_spec_version, SANDESHA2_SPEC_VERSION_1_0))
+    if(0  == axis2_strcmp(rm_spec_version, SANDESHA2_SPEC_VERSION_1_0))
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_EMPTY_ACK_REQUEST_MESSAGE, 
                 AXIS2_FAILURE);
@@ -1129,7 +1129,7 @@
     }
     out_seq_id = sandesha2_client_get_seq_id(env, svc_client);
     soap_ns_uri = (axis2_char_t *) AXIS2_OPTIONS_GET_SOAP_VERSION_URI(options, env);
-    if(0 == AXIS2_STRCMP(AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
+    if(0 == axis2_strcmp(AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
     {
         dummy_envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
                 AXIOM_SOAP11); 
@@ -1245,7 +1245,7 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
             SANDESHA2_CLIENT_SEQ_KEY);
     seq_key = axis2_property_get_value(property, env);
@@ -1302,7 +1302,7 @@
         return NULL;
     }
     soap_ns_uri = (axis2_char_t *) AXIS2_OPTIONS_GET_SOAP_VERSION_URI(options, env);
-    if(0 == AXIS2_STRCMP(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
+    if(0 == axis2_strcmp(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
     {
         dummy_envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
                 AXIOM_SOAP12); 
@@ -1358,7 +1358,7 @@
     seq_terminated_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
             out_seq_id, SANDESHA2_SEQ_PROP_SEQ_TERMINATED);
     value = sandesha2_seq_property_bean_get_value(seq_terminated_bean, env);
-    if(seq_terminated_bean != NULL && 0 == AXIS2_STRCMP(SANDESHA2_VALUE_TRUE, value))
+    if(seq_terminated_bean != NULL && 0 == axis2_strcmp(SANDESHA2_VALUE_TRUE, value))
     {
         return AXIS2_TRUE;
     }
@@ -1400,7 +1400,7 @@
     seq_terminated_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
             out_seq_id, SANDESHA2_SEQ_PROP_SEQ_TIMED_OUT);
     value = sandesha2_seq_property_bean_get_value(seq_terminated_bean, env);
-    if(seq_terminated_bean != NULL && 0 == AXIS2_STRCMP(SANDESHA2_VALUE_TRUE, value))
+    if(seq_terminated_bean != NULL && 0 == axis2_strcmp(SANDESHA2_VALUE_TRUE, value))
     {
         return AXIS2_TRUE;
     }
@@ -1498,7 +1498,7 @@
     completed_msg_list = sandesha2_ack_mgr_get_client_completed_msgs_list(env,
             out_seq_id, seq_prop_mgr);
     if(completed_msg_list)
-        size = AXIS2_ARRAY_LIST_SIZE(completed_msg_list, env);
+        size = axis2_array_list_size(completed_msg_list, env);
     for(i = 0; i < size; i++)
     {
         axis2_char_t *value = NULL;
@@ -1581,12 +1581,12 @@
     storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf); 
     seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env); 
     ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
-    property = AXIS2_CTX_GET_PROPERTY(ctx, env, SANDESHA2_WITHIN_TRANSACTION, 
+    property = axis2_ctx_get_property(ctx, env, SANDESHA2_WITHIN_TRANSACTION, 
         AXIS2_FALSE);
     if(property)
         within_transaction_str = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE(
             property, env);
-    if(within_transaction_str && 0 == AXIS2_STRCMP(within_transaction_str, 
+    if(within_transaction_str && 0 == axis2_strcmp(within_transaction_str, 
                 SANDESHA2_VALUE_TRUE))
     {
         within_transaction = AXIS2_TRUE;
@@ -1600,7 +1600,7 @@
     completed_msg_list = sandesha2_ack_mgr_get_svr_completed_msgs_list(env, 
             seq_id, seq_prop_mgr);
     if(completed_msg_list)
-        size = AXIS2_ARRAY_LIST_SIZE(completed_msg_list, env);
+        size = axis2_array_list_size(completed_msg_list, env);
     for(i = 0; i < size; i++)
     {
         long *lng = NULL;
@@ -1653,7 +1653,7 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
+    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
     property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
         SANDESHA2_CLIENT_SEQ_KEY);
     if(property)
@@ -1728,7 +1728,7 @@
         AXIS2_OPTIONS_SET_ACTION(options, env, action);
         soap_ns_uri = (axis2_char_t *) AXIS2_OPTIONS_GET_SOAP_VERSION_URI(options, 
             env);
-        if(0 == AXIS2_STRCMP(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
+        if(0 == axis2_strcmp(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_ns_uri))
         {
             dummy_envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
                 AXIOM_SOAP12); 
@@ -1888,7 +1888,7 @@
         return AXIS2_FALSE;
     }
 
-    if (AXIS2_STRCMP(soap_version_uri,
+    if (axis2_strcmp(soap_version_uri,
             AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0)
         soap_version = AXIOM_SOAP11;
     else
@@ -1917,5 +1917,73 @@
     AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, envelope);
 
     return AXIS2_TRUE;
+}
+
+/**
+ * In RM 1.0 two way single channel messaging user need
+ * to call for the response envelope.
+ *
+ * @param conf_ctx
+ * @param svc_client
+ * @param msg_no
+ * @return response soap envelope
+ */
+axiom_node_t *AXIS2_CALL
+sandesha2_client_get_response_envelope(
+    const axis2_env_t *env,
+    axis2_conf_ctx_t *conf_ctx,
+    axis2_svc_client_t *svc_client,
+    int msg_no)
+{
+    sandesha2_storage_mgr_t *storage_mgr = NULL;
+    axis2_conf_t *conf = NULL;
+    axis2_char_t *within_transaction_str = NULL;
+    axis2_bool_t within_transaction = AXIS2_FALSE;
+    sandesha2_transaction_t *transaction = NULL;
+    axis2_ctx_t *ctx = NULL;
+    axis2_property_t *property = NULL;
+    axis2_options_t *options = NULL;
+    axis2_char_t *client_seq_key = NULL;
+    axiom_soap_envelope_t *response_envelope = NULL;
+    axiom_soap_body_t *body = NULL;
+    axiom_node_t *result = NULL;
+
+    options = (axis2_options_t *) AXIS2_SVC_CLIENT_GET_OPTIONS(svc_client, env);
+    if(!options)
+    {
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_OPTIONS_OBJECT_NOT_SET, 
+            AXIS2_FAILURE);
+        return NULL;
+    }
+    property = (axis2_property_t *) AXIS2_OPTIONS_GET_PROPERTY(options, env, 
+        SANDESHA2_CLIENT_SEQ_KEY);
+    client_seq_key = axis2_property_get_value(property, env);
+    conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
+    storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
+    ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
+    property = (axis2_property_t *) axis2_ctx_get_property(ctx, env, 
+        SANDESHA2_WITHIN_TRANSACTION, AXIS2_FALSE);
+    if(property)
+        within_transaction_str = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE(
+            property, env);
+    if(within_transaction_str && 0 == axis2_strcmp(within_transaction_str, 
+        SANDESHA2_VALUE_TRUE))
+    {
+        within_transaction = AXIS2_TRUE;
+    }
+    if(AXIS2_TRUE != within_transaction)
+    {
+        transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
+    }
+    response_envelope = sandesha2_storage_mgr_retrieve_response(storage_mgr, env, 
+        client_seq_key, msg_no);
+    if(response_envelope)
+        body = axiom_soap_envelope_get_body(response_envelope, env);
+    if(body)
+        result = axiom_soap_body_get_base_node(body, env);
+    sandesha2_storage_mgr_remove_response(storage_mgr, env, client_seq_key, 
+        msg_no);
+    sandesha2_transaction_commit(transaction, env);
+    return result;
 }
 

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c Mon Feb 26 00:57:07 2007
@@ -95,7 +95,6 @@
     sandesha2_msg_processor_t *msg_processor = NULL;
     sandesha2_seq_ack_t *seq_ack = NULL;
     sandesha2_ack_requested_t *ack_requested = NULL;
-
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     
     AXIS2_LOG_INFO(env->log, "[sandesha2] Starting in handler .........");
@@ -210,7 +209,7 @@
      * SANDESHA2_MSG_VALIDATOR_VALIDATE(env, rm_msg_ctx, storage_mgr);
      */
     seq_ack = (sandesha2_seq_ack_t*)sandesha2_msg_ctx_get_msg_part(rm_msg_ctx, 
-                        env, SANDESHA2_MSG_PART_SEQ_ACKNOWLEDGEMENT);
+        env, SANDESHA2_MSG_PART_SEQ_ACKNOWLEDGEMENT);
     if(seq_ack)
     {
         sandesha2_msg_processor_t *ack_proc = NULL;
@@ -218,15 +217,15 @@
         sandesha2_msg_processor_process_in_msg(ack_proc, env, rm_msg_ctx);
     }
     ack_requested = (sandesha2_ack_requested_t*)sandesha2_msg_ctx_get_msg_part(
-                        rm_msg_ctx, env, SANDESHA2_MSG_PART_ACK_REQUEST);
+        rm_msg_ctx, env, SANDESHA2_MSG_PART_ACK_REQUEST);
     if(ack_requested)
     {
         sandesha2_ack_requested_set_must_understand(ack_requested, env, 
-                        AXIS2_FALSE);
+            AXIS2_FALSE);
         sandesha2_msg_ctx_add_soap_envelope(rm_msg_ctx, env);
     }
     msg_processor = sandesha2_msg_processor_create_msg_processor(env, 
-            rm_msg_ctx);
+        rm_msg_ctx);
     if(msg_processor)
     {
         sandesha2_msg_processor_process_in_msg(msg_processor, env, rm_msg_ctx);

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Mon Feb 26 00:57:07 2007
@@ -238,96 +238,6 @@
     if(temp_prop)
         axis2_property_set_value(temp_prop, env, AXIS2_STRDUP(
             SANDESHA2_VALUE_FALSE, env));
-    if(!axis2_msg_ctx_get_server_side(msg_ctx, env))
-    {
-        axis2_op_t *op = NULL;
-        axis2_op_ctx_t *op_ctx = NULL;
-        axis2_endpoint_ref_t *to_epr = NULL;
-        axis2_endpoint_ref_t *reply_to_epr = NULL;
-        axis2_char_t *reply_to_addr = NULL;
-        axis2_bool_t single_channel_two_way = AXIS2_FALSE;
-        int mep = -1, size = 0, i = 0;
-        op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-        op = axis2_op_ctx_get_op(op_ctx, env);
-        mep = AXIS2_OP_GET_AXIS_SPECIFIC_MEP_CONST(op, env);
-        to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
-        reply_to_epr = axis2_msg_ctx_get_reply_to(msg_ctx, env);
-        if(reply_to_epr)
-            reply_to_addr = axis2_endpoint_ref_get_address(reply_to_epr, env);
-        single_channel_two_way = (sandesha2_utils_is_anon_uri(env, 
-            reply_to_addr)) && AXIS2_MEP_CONSTANT_OUT_IN == mep;
-        if(single_channel_two_way)
-        {
-            axis2_char_t *to = NULL;
-            axis2_property_t *property = NULL;
-            axis2_char_t *seq_key = NULL;
-            sandesha2_sender_mgr_t *retrans_mgr = NULL;
-            sandesha2_sender_bean_t *target_bean = NULL;
-            axis2_array_list_t *found_list = NULL;
-            axis2_char_t *msg_id = NULL;
-            axis2_char_t *internal_seq_id = NULL;
-            axis2_bool_t match = AXIS2_FALSE;
-
-            printf("single channel two way\n");
-            target_bean = sandesha2_sender_bean_create(env);
-            to = (axis2_char_t*)AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr, env);
-            property = axis2_msg_ctx_get_property(msg_ctx, env, 
-                SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
-            if(property)
-                seq_key = axis2_property_get_value(property, env);
-            internal_seq_id = sandesha2_utils_get_internal_seq_id(env, 
-            to, seq_key);
-            sandesha2_sender_bean_set_internal_seq_id(target_bean, env, internal_seq_id);
-            sandesha2_sender_bean_set_send(target_bean, env, AXIS2_TRUE);
-            sandesha2_sender_bean_set_resend(target_bean, env, AXIS2_TRUE);
-            retrans_mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
-            while(!match)
-            {
-                transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
-                found_list = sandesha2_sender_mgr_find_by_sender_bean(retrans_mgr, env, 
-                    target_bean);
-                msg_id = axis2_msg_ctx_get_msg_id(msg_ctx, env);
-                if(found_list)
-                    size = AXIS2_ARRAY_LIST_SIZE(found_list, env);
-                for(i = 0; i < size; i++)
-                {
-                    sandesha2_sender_bean_t *tmp_bean = NULL;
-                    axis2_char_t *key = NULL;
-                    axis2_msg_ctx_t *app_msg_ctx = NULL;
-                    axis2_char_t *rm_ver = NULL;
-                    axis2_char_t *assumed_rm_ns = NULL;
-                    sandesha2_msg_ctx_t *app_rm_msg = NULL;
-                    sandesha2_seq_t *seq_part = NULL;
-                    sandesha2_identifier_t *ident = NULL;
-                    axis2_char_t *temp_msg_id = NULL;
-                    
-                    tmp_bean = AXIS2_ARRAY_LIST_GET(found_list, env, i);
-                    key = sandesha2_sender_bean_get_msg_ctx_ref_key(tmp_bean, env);
-                    app_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
-                        key, conf_ctx);
-                    if(!app_msg_ctx)
-                    {
-                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Unavailable"
-                            " application message");
-                        return AXIS2_FAILURE;
-                    }
-                    temp_msg_id = axis2_msg_ctx_get_msg_id(app_msg_ctx, env);
-                    if(0 == axis2_strcmp(msg_id, temp_msg_id))
-                    {
-                        axiom_soap_envelope_t *res_envelope = NULL;
-                        AXIS2_SLEEP(2);
-                        match = AXIS2_TRUE;
-                    }
-                }//for
-                if(!match)
-                {
-                    sandesha2_transaction_commit(transaction, env);
-                    AXIS2_SLEEP(1);
-                }
-            }//while
-            sandesha2_transaction_commit(transaction, env);
-        }
-    }
     AXIS2_LOG_INFO(env->log, "[sandesha2] Exit: sandesha2_out_handler::invoke");
     return AXIS2_SUCCESS;
 }

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Mon Feb 26 00:57:07 2007
@@ -34,6 +34,7 @@
 #include <sandesha2_utils.h>
 #include <sandesha2_msg_ctx.h>
 #include <sandesha2_create_seq_mgr.h>
+#include <sandesha2_create_seq_bean.h>
 #include <sandesha2_sender_mgr.h>
 #include <sandesha2_sender_bean.h>
 
@@ -261,7 +262,7 @@
                 AXIS2_FAILURE);
             return AXIS2_FAILURE;
         }
-        AXIS2_MSG_CTX_SET_PAUSED(msg_ctx, env, AXIS2_TRUE);
+        axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
         return AXIS2_SUCCESS;
     }
     seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
@@ -283,7 +284,7 @@
                         AXIS2_FAILURE);
             return AXIS2_FAILURE;
         }
-        AXIS2_MSG_CTX_SET_PAUSED(msg_ctx, env, AXIS2_TRUE);
+        axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
         return AXIS2_SUCCESS;
     }
     sandesha2_seq_set_must_understand(seq, env, AXIS2_FALSE);
@@ -300,7 +301,7 @@
                 AXIS2_FAILURE);
             return AXIS2_FAILURE;
         }
-        AXIS2_MSG_CTX_SET_PAUSED(msg_ctx, env, AXIS2_TRUE);
+        axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
         return AXIS2_SUCCESS;
     }
     sandesha2_seq_mgr_update_last_activated_time(env, str_seq_id, 
@@ -337,6 +338,10 @@
         sandesha2_seq_property_bean_t *highest_msg_key_bean = NULL;
         sandesha2_seq_property_bean_t *highest_msg_id_bean = NULL;
         const axis2_char_t *msg_id = NULL;
+        axiom_soap_envelope_t *response_envelope = NULL;
+        int soap_version = -1;
+        axis2_property_t *property = NULL;
+        axis2_char_t *client_seq_key = NULL;
         
         highest_in_msg_no = msg_no;
         msg_id = axis2_msg_ctx_get_msg_id(msg_ctx, env);
@@ -353,6 +358,20 @@
             highest_in_msg_key_str);
         sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, 
             highest_in_msg_key_str, msg_ctx);
+        response_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
+        property = axis2_msg_ctx_get_property(msg_ctx, env, 
+            SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
+        if(property)
+            client_seq_key = axis2_property_get_value(property, env);
+        if(client_seq_key)
+        {
+            if(axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
+                soap_version = SANDESHA2_SOAP_VERSION_1_1;
+            else
+                soap_version = SANDESHA2_SOAP_VERSION_1_2;
+            sandesha2_storage_mgr_store_response(storage_mgr, env, client_seq_key, 
+                response_envelope, msg_no, soap_version);
+        }
         if(highest_in_msg_no_str)
         {
             sandesha2_seq_property_mgr_update(seq_prop_mgr, env, 
@@ -602,7 +621,7 @@
         AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
     /*axis2_allocator_switch_to_local_pool(env->allocator);*/
     seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
-                        storage_mgr, env);
+        storage_mgr, env);
     if(!seq_prop_mgr)
     {
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "seq_prop_mgr is NULL");
@@ -973,7 +992,11 @@
     if(!dummy_msg)
         sandesha2_app_msg_processor_process_response_msg(env, rm_msg_ctx, 
                 internal_seq_id, msg_number, storage_key, storage_mgr);
-    AXIS2_MSG_CTX_SET_PAUSED(msg_ctx, env, AXIS2_TRUE);    
+    /*if(1 < msg_number && !axis2_msg_ctx_get_server_side(msg_ctx, env))
+    {
+        return AXIS2_SUCCESS;
+    }*/
+    axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);    
     AXIS2_LOG_INFO(env->log, 
         "[sandesha2] Exit: sandesha2_app_msg_processor_process_out_msg");
     return AXIS2_SUCCESS;
@@ -1371,6 +1394,10 @@
     sandesha2_msg_ctx_add_soap_envelope(rm_msg_ctx, env);
     app_msg_entry = sandesha2_sender_bean_create(env);
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "sandesha to_addr = %s ", to_addr);
+    /*if(1 < msg_num && !axis2_msg_ctx_get_server_side(app_msg_ctx, env))
+    {
+        return AXIS2_SUCCESS;
+    }*/
     if(axis2_msg_ctx_get_server_side(app_msg_ctx, env) &&
        sandesha2_utils_is_single_channel(env, rm_version, to_addr))
     {

Modified: webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c Mon Feb 26 00:57:07 2007
@@ -221,7 +221,7 @@
                         AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    relates_to = AXIS2_MSG_CTX_GET_RELATES_TO(msg_ctx, env);
+    relates_to = axis2_msg_ctx_get_relates_to(msg_ctx, env);
     if(!relates_to)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] invalid create"
@@ -234,21 +234,21 @@
     retrans_mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
     create_seq_mgr = sandesha2_storage_mgr_get_create_seq_mgr(storage_mgr, env);
     create_seq_bean = sandesha2_create_seq_mgr_retrieve(create_seq_mgr, env,
-                        create_seq_msg_id);
+        create_seq_msg_id);
     if(!create_seq_bean)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Create Sequence "
-                        "entry is not found");
+            "entry is not found");
         return AXIS2_FAILURE;
     }
     int_seq_id = sandesha2_create_seq_bean_get_internal_seq_id(create_seq_bean,
-                        env);
+        env);
     if(!int_seq_id)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] temp_sequence_id"
-                        " has is not set");
+            " has is not set");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_FIND_SEQ_ID,
-                        AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     sandesha2_create_seq_bean_set_seq_id(create_seq_bean, env, new_out_seq_id);

Modified: webservices/sandesha/trunk/c/src/storage/permanent/permanent_bean_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/permanent/permanent_bean_mgr.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_bean_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_bean_mgr.c Mon Feb 26 00:57:07 2007
@@ -47,6 +47,54 @@
     ((sandesha2_permanent_bean_mgr_impl_t *) bean_mgr)
 
 static int 
+sandesha2_permanent_bean_mgr_count_callback(
+    void *not_used, 
+    int argc, 
+    char **argv, 
+    char **col_name)
+{
+    int *count = (int *) not_used;
+    *count = AXIS2_ATOI(argv[0]);
+    return 0;
+}
+
+static int 
+sandesha2_permanent_bean_mgr_response_retrieve_callback(
+    void *not_used, 
+    int argc, 
+    char **argv, 
+    char **col_name)
+{
+    int i = 0;
+    sandesha2_response_t *response = NULL;
+    sandesha2_bean_mgr_args_t *args = (sandesha2_bean_mgr_args_t *) not_used;
+    const axis2_env_t *env = args->env;
+    if(argc < 1)
+    {
+        args->data = NULL;
+        return 0;
+    }
+    response = (sandesha2_response_t *) args->data;
+    if(!response && argc > 0)
+    {
+        response = (sandesha2_response_t *) AXIS2_MALLOC(env->allocator, sizeof(
+            sandesha2_response_t));
+        args->data = response;
+    }
+    for(i = 0; i < argc; i++)
+    {
+        if(0 == AXIS2_STRCMP(col_name[i], "response_str"))
+            if(argv[i])
+                response->response_str = axis2_strdup(argv[i], env);
+        if(0 == AXIS2_STRCMP(col_name[i], "soap_version"))
+            if(argv[i])
+                response->soap_version = axis2_atoi(argv[i]);
+    }
+    return 0;
+}
+
+
+static int 
 sandesha2_msg_store_bean_retrieve_callback(
     void *not_used, 
     int argc, 
@@ -921,6 +969,200 @@
     AXIS2_LOG_INFO(env->log, 
         "[sandesha2]Exit:sandesha2_permanent_bean_mgr_remove_msg_store_bean");
     return AXIS2_TRUE;
+}
+
+axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_store_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axis2_char_t *response,
+    int msg_no,
+    int soap_version)
+{
+    axis2_char_t sql_stmt_count[512];
+    axis2_char_t *sql_stmt_update;
+    axis2_char_t *sql_stmt_insert;
+    axis2_char_t *error_msg = NULL;
+    int rc = -1;
+    int sql_size = -1;
+    sqlite3 *dbconn = NULL;
+	sandesha2_permanent_bean_mgr_impl_t *bean_mgr_impl = NULL;
+    int count = -1;
+
+	bean_mgr_impl = SANDESHA2_INTF_TO_IMPL(bean_mgr);
+    AXIS2_LOG_INFO(env->log, 
+        "[sandesha2]Start:sandesha2_permanent_bean_mgr_store_response");
+    sql_size = AXIS2_STRLEN(seq_id) + AXIS2_STRLEN(response) + 
+        sizeof(int) + sizeof(int) + 512;
+    sprintf(sql_stmt_count, "select count(seq_id)"\
+        " from response where seq_id = '%s' and msg_no=%d", seq_id, msg_no);
+
+    axis2_thread_mutex_lock(bean_mgr_impl->mutex);
+    dbconn = (sqlite3 *) sandesha2_permanent_storage_mgr_get_dbconn(
+        bean_mgr_impl->storage_mgr, env);
+    if(!dbconn)
+        return AXIS2_FALSE;
+    rc = sqlite3_exec(dbconn, sql_stmt_count, 
+        sandesha2_permanent_bean_mgr_count_callback, &count, &error_msg);
+    if(rc == SQLITE_BUSY)
+        rc = sandesha2_permanent_bean_mgr_busy_handler(dbconn, sql_stmt_count, 
+            sandesha2_permanent_bean_mgr_count_callback, &count, &error_msg, rc);
+    if(rc != SQLITE_OK )
+    {
+        axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s", 
+            error_msg);
+        printf("sql_stmt_count:%s\n", sql_stmt_count);
+        printf("retrieve error_msg:%s\n", error_msg);
+        sqlite3_free(error_msg);
+        return AXIS2_FALSE;
+    }
+    if(count > 0)
+    {
+        sql_stmt_update = AXIS2_MALLOC(env->allocator, sql_size);
+        sprintf(sql_stmt_update, "update response set response_str='%s',"\
+            "soap_version=%d where seq_id='%s' and msg_no=%d", response, 
+            soap_version, seq_id, msg_no);
+        rc = sqlite3_exec(dbconn, sql_stmt_update, 0, 0, &error_msg);
+        if(rc == SQLITE_BUSY)
+            rc = sandesha2_permanent_bean_mgr_busy_handler(dbconn, sql_stmt_update, 
+                0, 0, &error_msg, rc);
+        if( rc != SQLITE_OK )
+        {
+            axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+            AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, 
+                AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s", 
+                error_msg);
+            printf("sql_stmt_update:%s\n", sql_stmt_update);
+            printf("update error_msg:%s\n", error_msg);
+            AXIS2_FREE(env->allocator, sql_stmt_update);
+            sqlite3_free(error_msg);
+            return AXIS2_FALSE;
+        }
+        AXIS2_FREE(env->allocator, sql_stmt_update);
+        axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+        return AXIS2_TRUE;
+    }
+    else
+    {
+        sql_stmt_insert = AXIS2_MALLOC(env->allocator, sql_size);
+        sprintf(sql_stmt_insert, "insert into response(seq_id, response_str,"\
+            "msg_no, soap_version) values('%s', '%s', %d, %d)", seq_id, 
+            response, msg_no, soap_version);
+        rc = sqlite3_exec(dbconn, sql_stmt_insert, 0, 0, &error_msg);
+        if(rc == SQLITE_BUSY)
+            rc = sandesha2_permanent_bean_mgr_busy_handler(dbconn, sql_stmt_insert, 
+                0, 0, &error_msg, rc);
+        if( rc != SQLITE_OK )
+        {
+            axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+            AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s", error_msg);
+            printf("sql_stmt_insert:%s\n", sql_stmt_insert);
+            printf("insert error_msg:%s\n", error_msg);
+            AXIS2_FREE(env->allocator, sql_stmt_insert);
+            sqlite3_free(error_msg);
+            return AXIS2_FALSE;
+        }
+        AXIS2_FREE(env->allocator, sql_stmt_insert);
+        axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+    }
+    AXIS2_LOG_INFO(env->log, 
+        "[sandesha2]Exit:sandesha2_permanent_bean_mgr_store_response");
+    return AXIS2_TRUE;
+}
+
+axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_remove_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+    axis2_char_t sql_stmt_remove[256];
+    sandesha2_permanent_bean_mgr_impl_t *bean_mgr_impl = NULL;
+    axis2_char_t *error_msg = NULL;
+    int rc = -1;
+    sqlite3 *dbconn = NULL;
+    AXIS2_LOG_INFO(env->log, 
+        "[sandesha2]Entry:sandesha2_permanent_bean_mgr_remove_response");
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    bean_mgr_impl = SANDESHA2_INTF_TO_IMPL(bean_mgr);
+    axis2_thread_mutex_lock(bean_mgr_impl->mutex);
+    dbconn = (sqlite3 *) sandesha2_permanent_storage_mgr_get_dbconn(
+        bean_mgr_impl->storage_mgr, env);
+    if(!dbconn)
+        return AXIS2_FALSE;
+    sprintf(sql_stmt_remove, 
+        "delete from response where seq_id='%s' and msg_no=%d", seq_id, msg_no);
+    rc = sqlite3_exec(dbconn, sql_stmt_remove, 0, 0, &error_msg);
+    if(rc == SQLITE_BUSY)
+        rc = sandesha2_permanent_bean_mgr_busy_handler(dbconn, sql_stmt_remove, 
+            0, 0, &error_msg, rc);
+    if(rc != SQLITE_OK )
+    {
+        axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s",
+            error_msg);
+        printf("sql_stmt_remove:%s\n", sql_stmt_remove);
+        printf("remove error_msg:%s\n", error_msg);
+        sqlite3_free(error_msg);
+        return AXIS2_FALSE;
+    }
+    axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+    AXIS2_LOG_INFO(env->log, 
+        "[sandesha2]Exit:sandesha2_permanent_bean_mgr_remove_response");
+    return AXIS2_TRUE;
+}
+
+sandesha2_response_t *AXIS2_CALL
+sandesha2_permanent_bean_mgr_retrieve_response(
+    sandesha2_permanent_bean_mgr_t *bean_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+    sandesha2_permanent_bean_mgr_impl_t *bean_mgr_impl = NULL;
+    sandesha2_bean_mgr_args_t *args = NULL;
+    axis2_char_t *error_msg = NULL;
+    int rc = -1;
+    sqlite3 *dbconn = NULL;
+    axis2_char_t sql_stmt_retrieve[512];
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    bean_mgr_impl = SANDESHA2_INTF_TO_IMPL(bean_mgr);
+    axis2_thread_mutex_lock(bean_mgr_impl->mutex);
+    dbconn = (sqlite3 *) sandesha2_permanent_storage_mgr_get_dbconn(
+        bean_mgr_impl->storage_mgr, env);
+    if(!dbconn)
+        return NULL;
+    args = AXIS2_MALLOC(env->allocator, sizeof(sandesha2_bean_mgr_args_t));
+    args->env = (axis2_env_t*)env;
+    args->data = NULL;
+    sprintf(sql_stmt_retrieve, "select response_str, soap_version from response"\
+        " where seq_id='%s' and msg_no=%d", seq_id, msg_no);
+    rc = sqlite3_exec(dbconn, sql_stmt_retrieve, 
+        sandesha2_permanent_bean_mgr_response_retrieve_callback, args, &error_msg);
+    if(rc == SQLITE_BUSY)
+        rc = sandesha2_permanent_bean_mgr_busy_handler(dbconn, sql_stmt_retrieve, 
+            sandesha2_permanent_bean_mgr_response_retrieve_callback, args, 
+            &error_msg, rc);
+    if(rc != SQLITE_OK )
+    {
+        axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s",
+            error_msg);
+        printf("sql_stmt_retrieve:%s\n", sql_stmt_retrieve);
+        printf("retrieve error_msg:%s\n", error_msg);
+        sqlite3_free(error_msg);
+        return AXIS2_FALSE;
+    }
+    axis2_thread_mutex_unlock(bean_mgr_impl->mutex);
+    return (sandesha2_response_t *) args->data;
 }
 
 int

Modified: webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c Mon Feb 26 00:57:07 2007
@@ -189,6 +189,29 @@
     axiom_soap_envelope_t *soap_env,
     axis2_char_t *key);
 
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_store_response(
+    sandesha2_storage_mgr_t *storage_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axiom_soap_envelope_t *response,
+    int msg_no,
+    int soap_version);
+
+axiom_soap_envelope_t * AXIS2_CALL
+sandesha2_permanent_storage_mgr_retrieve_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no);
+
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_remove_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no);
+
 static sandesha2_msg_store_bean_t *AXIS2_CALL
 sandesha2_permanent_storage_mgr_get_msg_store_bean (
     sandesha2_storage_mgr_t *storage_mgr,
@@ -225,7 +248,10 @@
     sandesha2_permanent_storage_mgr_remove_msg_ctx,
     sandesha2_permanent_storage_mgr_init_storage,
     sandesha2_permanent_storage_mgr_retrieve_soap_envelope,
-    sandesha2_permanent_storage_mgr_store_soap_envelope
+    sandesha2_permanent_storage_mgr_store_soap_envelope,
+    sandesha2_permanent_storage_mgr_store_response,
+    sandesha2_permanent_storage_mgr_retrieve_response,
+    sandesha2_permanent_storage_mgr_remove_response
 };
 
 AXIS2_EXTERN sandesha2_storage_mgr_t * AXIS2_CALL
@@ -1146,5 +1172,108 @@
     }
     /*axis2_thread_mutex_unlock(storage_mgr_impl->mutex);*/
     return dbconn;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_store_response(
+    sandesha2_storage_mgr_t *storage_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axiom_soap_envelope_t *response,
+    int msg_no,
+    int soap_version)
+{
+    sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
+    axis2_char_t *response_str = NULL;
+    axiom_xml_writer_t *xml_writer = NULL;
+    axiom_output_t *om_output = NULL;
+    storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+
+    if (!response)
+    {
+        AXIS2_ERROR_SET(env->error,
+            AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
+            AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
+            AXIS2_ERROR_GET_MESSAGE(env->error));
+        return AXIS2_FAILURE;
+    }
+    xml_writer = axiom_xml_writer_create_for_memory(env, NULL,
+        AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
+    if (!xml_writer)
+    {
+        return AXIS2_FAILURE;
+    }
+    om_output = axiom_output_create(env, xml_writer);
+    if (!om_output)
+    {
+        AXIOM_XML_WRITER_FREE(xml_writer, env);
+        xml_writer = NULL;
+        return AXIS2_FAILURE;
+    }
+    AXIOM_SOAP_ENVELOPE_SERIALIZE(response, env, om_output, AXIS2_FALSE);
+    response_str = (axis2_char_t *)AXIOM_XML_WRITER_GET_XML(xml_writer, env);
+
+    sandesha2_permanent_bean_mgr_store_response(storage_mgr_impl->bean_mgr, 
+        env, seq_id, response_str, msg_no, soap_version);
+    return AXIS2_SUCCESS;
+}
+	
+axiom_soap_envelope_t * AXIS2_CALL
+sandesha2_permanent_storage_mgr_retrieve_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+    sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
+    sandesha2_response_t *response = NULL;
+    axiom_soap_envelope_t *response_envelope = NULL;
+    axiom_xml_reader_t *reader = NULL;
+    int soap_version = -1;
+    axiom_stax_builder_t *om_builder = NULL;
+    axiom_soap_builder_t *soap_builder = NULL;
+
+    storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+    response = sandesha2_permanent_bean_mgr_retrieve_response(
+        storage_mgr_impl->bean_mgr, env, seq_id, msg_no);
+    if(!response)
+    {
+        return NULL;
+    }
+    reader = axiom_xml_reader_create_for_memory(env, response->response_str, 
+        AXIS2_STRLEN(response->response_str), NULL, AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_builder = axiom_stax_builder_create(env, reader);
+    soap_version = response->soap_version;
+    if(SANDESHA2_SOAP_VERSION_1_1 == soap_version)
+    {
+        soap_builder = axiom_soap_builder_create(env, om_builder,
+            AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI);
+    }
+    else if(SANDESHA2_SOAP_VERSION_1_2 == soap_version)
+    {
+        soap_builder = axiom_soap_builder_create(env, om_builder,
+            AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI);
+    }
+    response_envelope = AXIOM_SOAP_BUILDER_GET_SOAP_ENVELOPE(soap_builder, env);
+    if(!response_envelope)
+    {
+        AXIOM_SOAP_BUILDER_FREE(soap_builder, env);
+    }
+    return response_envelope;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_remove_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+    sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
+
+    storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+    return sandesha2_permanent_bean_mgr_remove_response(
+        storage_mgr_impl->bean_mgr, env, seq_id, msg_no);
 }
 

Modified: webservices/sandesha/trunk/c/src/storage/storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/storage_mgr.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/storage_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/storage_mgr.c Mon Feb 26 00:57:07 2007
@@ -200,3 +200,36 @@
      return storage_mgr->ops->store_soap_envelope(storage_mgr, env, soap_env, key);
 }
 
+axis2_status_t AXIS2_CALL
+sandesha2_storage_mgr_store_response(
+    sandesha2_storage_mgr_t *storage_mgr,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id,
+    axiom_soap_envelope_t *response,
+    int msg_no,
+    int soap_version)
+{
+     return storage_mgr->ops->store_response(storage_mgr, env, seq_id, response, 
+         msg_no, soap_version);
+}
+
+axiom_soap_envelope_t * AXIS2_CALL
+sandesha2_storage_mgr_retrieve_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+     return storage_mgr->ops->retrieve_response(storage_mgr, env, seq_id, 
+         msg_no);
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_storage_mgr_remove_response(
+    sandesha2_storage_mgr_t *storage_mgr, 
+    const axis2_env_t *env, 
+    axis2_char_t *seq_id,
+    int msg_no)
+{
+     return storage_mgr->ops->remove_response(storage_mgr, env, seq_id, msg_no);
+}

Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?view=diff&rev=511757&r1=511756&r2=511757
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Mon Feb 26 00:57:07 2007
@@ -24,6 +24,7 @@
 #include <sandesha2_seq_property_mgr.h>
 #include <sandesha2_msg_ctx.h>
 #include <sandesha2_seq.h>
+#include <sandesha2_client_constants.h>
 #include <axis2_addr.h>
 #include <axis2_engine.h>
 #include <stdlib.h>
@@ -599,9 +600,11 @@
 
     res_envelope = axis2_msg_ctx_get_response_soap_envelope(msg_ctx, env);
     if(!res_envelope)
+    {
         res_envelope = axis2_http_transport_utils_create_soap_msg(env, msg_ctx,
             soap_ns_uri);
-   
+        axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env, res_envelope);
+    }
     property = axis2_msg_ctx_get_property(msg_ctx, env, 
         SANDESHA2_WITHIN_TRANSACTION, AXIS2_FALSE);
     if(property)
@@ -609,6 +612,13 @@
     if(new_property)
         axis2_msg_ctx_set_property(res_msg_ctx, env, 
             SANDESHA2_WITHIN_TRANSACTION, new_property, AXIS2_FALSE);
+    property = axis2_msg_ctx_get_property(msg_ctx, env, 
+        SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
+    if(property)
+        new_property = axis2_property_clone(property, env);
+    if(new_property)
+        axis2_msg_ctx_set_property(res_msg_ctx, env, 
+            SANDESHA2_CLIENT_SEQ_KEY, new_property, AXIS2_FALSE);
     if(res_envelope)
     {
         axis2_engine_t *engine = NULL;



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org