Author: damitha
Date: Wed Jul 30 05:33:58 2008
New Revision: 680999

URL: http://svn.apache.org/viewvc?rev=680999&view=rev
Log:
Fixing memory leaks

Modified:
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_0/rm_echo_single.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/ack_mgr.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_retrans_adjuster.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/msg_number.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/seq_ack.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/sequence.c

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_0/rm_echo_single.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_0/rm_echo_single.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_0/rm_echo_single.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/rm_echo_single_1_0/rm_echo_single.c
 Wed Jul 30 05:33:58 2008
@@ -96,6 +96,11 @@
     
     soap_action = axutil_string_create(env, "urn:wsrm:EchoString");
     axis2_options_set_soap_action(options, env, soap_action);
+    if(soap_action)
+    {
+        axutil_string_free(soap_action, env);
+    }
+
     axis2_options_set_action(options, env, "urn:wsrm:EchoString");
 
     /* Set up deploy folder. It is from the deploy folder, the configuration 
is 
@@ -159,6 +164,7 @@
         axis2_options_set_property(options, env, AXIS2_TIMEOUT_IN_SECONDS, 
             property);
     }
+
     payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
     result = axis2_svc_client_send_receive(svc_client, env, payload);
     if(result)

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
 Wed Jul 30 05:33:58 2008
@@ -320,19 +320,23 @@
                 if(msg_no_list)
                 {
                     size = axutil_array_list_size(msg_no_list, env);
-                }
-
-                for(i = 0; i < size; i++)
-                {
-                    axis2_char_t *temp = NULL;
-                    
-                    temp = axutil_array_list_get(msg_no_list, env, i);
-                    if(atol(temp) == msg_no)
+                    for(i = 0; i < size; i++)
                     {
-                        drop = AXIS2_TRUE;
+                        axis2_char_t *temp = NULL;
+                        
+                        temp = axutil_array_list_get(msg_no_list, env, i);
+                        if(atol(temp) == msg_no)
+                        {
+                            drop = AXIS2_TRUE;
+                        }
+
+                        AXIS2_FREE(env->allocator, temp);
                     }
+
+                    axutil_array_list_free(msg_no_list, env);
                 }
             }
+
             if(!drop)
             {
                 axiom_soap_body_t *soap_body = NULL;

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_out_handler.c
 Wed Jul 30 05:33:58 2008
@@ -39,8 +39,6 @@
     const axutil_env_t *env,
     struct axis2_msg_ctx *msg_ctx);
                                          
-/******************************************************************************/
                         
-
 AXIS2_EXTERN axis2_handler_t* AXIS2_CALL
 sandesha2_out_handler_create(
     const axutil_env_t *env, 
@@ -188,6 +186,7 @@
     if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
     {
         /* Message should not be sent in an exception situation */
+
         axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
         if(rm_msg_ctx)
         {

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
 Wed Jul 30 05:33:58 2008
@@ -223,9 +223,12 @@
     msg_proc_impl = SANDESHA2_INTF_TO_IMPL(msg_processor);
     
     if(msg_processor->ops)
+    {
         AXIS2_FREE(env->allocator, msg_processor->ops);
+    }
     
        AXIS2_FREE(env->allocator, SANDESHA2_INTF_TO_IMPL(msg_processor));
+
        return AXIS2_SUCCESS;
 }
 
@@ -1312,8 +1315,6 @@
         sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, 
res_last_msg_key_bean);
     }
 
-    rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
-            internal_sequence_id, SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);
 
     if(is_svr_side)
     {
@@ -1387,6 +1388,9 @@
     }
 
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Spec version:%s", spec_ver);
+    
+    rms_sequence_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
+            internal_sequence_id, SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID);
 
     if(1 == msg_number)
     {
@@ -1395,7 +1399,7 @@
             send_create_seq = AXIS2_TRUE;
         }
 
-        if(!is_svr_side)
+        /*if(!is_svr_side)
         {
             axutil_property_t *property = NULL;
             axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
@@ -1413,7 +1417,7 @@
 
                 axis2_ctx_set_property(ctx, env, SANDESHA2_MSG_CTX_MAP, 
property);
             }
-        }
+        }*/
 
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
                 "Starting the rms sequence with rms rms internal sequence id 
%s", 
@@ -1567,6 +1571,11 @@
             AXIS2_FREE(env->allocator, storage_key);
         }
     }
+   
+    if(axis2_msg_ctx_get_server_side(msg_ctx, env))
+    {
+        axis2_core_utils_reset_out_msg_ctx(env, msg_ctx);
+    }
 
     axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
 
@@ -1605,17 +1614,34 @@
 {
     axutil_array_list_t *list = NULL;
     axis2_char_t str_long[32];
+    axis2_bool_t ret = AXIS2_FALSE;
     
     AXIS2_PARAM_CHECK(env->error, str_list, AXIS2_FALSE);
     sprintf(str_long, "%ld", num);
     list = sandesha2_utils_get_array_list_from_string(env, str_list);
     if(list)
     {
+        int i = 0, size = 0;
+
         if(axutil_array_list_contains(list, env, str_long))
-            return AXIS2_TRUE;
+        {
+            ret =  AXIS2_TRUE;
+        }
+
+        size = axutil_array_list_size(list, env);
+        for(i = 0; i < size; i++)
+        {
+            axis2_char_t *str = axutil_array_list_get(list, env, i);
+            if(str)
+            {
+                AXIS2_FREE(env->allocator, str);
+                str = NULL;
+            }
+        }
         axutil_array_list_free(list, env);
     }
-    return AXIS2_FALSE;
+
+    return ret;
 }
 
 
@@ -2611,6 +2637,22 @@
                 sender_mgr);
     }
 
+    if(!is_svr_side && (!reply_to_addr || 
sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_version, reply_to_addr)))
+    {
+        if(!axutil_strcmp(mep, AXIS2_MEP_URI_OUT_IN))
+        {
+            sandesha2_seq_property_bean_t *replay_bean = NULL;
+
+            replay_bean = sandesha2_seq_property_bean_create_with_data(env, 
rms_sequence_id, 
+                    SANDESHA2_SEQ_PROP_1_0_REPLAY, NULL);
+            sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, replay_bean);
+            if(replay_bean)
+            {
+                sandesha2_seq_property_bean_free(replay_bean, env);
+            }
+        }
+    }
+
     engine = axis2_engine_create(env, conf_ctx);
     if(axis2_engine_resume_send(engine, env, app_msg_ctx))
     {
@@ -2652,19 +2694,6 @@
         axis2_transport_sender_t *transport_sender = NULL;
         sandesha2_sender_bean_t *sender_bean = NULL;
 
-        if(!axutil_strcmp(mep, AXIS2_MEP_URI_OUT_IN))
-        {
-            sandesha2_seq_property_bean_t *replay_bean = NULL;
-
-            replay_bean = sandesha2_seq_property_bean_create_with_data(env, 
rms_sequence_id, 
-                    SANDESHA2_SEQ_PROP_1_0_REPLAY, NULL);
-            sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, replay_bean);
-            if(replay_bean)
-            {
-                sandesha2_seq_property_bean_free(replay_bean, env);
-            }
-        }
-
         sender_bean = 
sandesha2_sender_mgr_get_application_msg_to_send(sender_mgr, env, 
                 internal_sequence_id, msg_id);
         if(!sender_bean)

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/terminate_seq_msg_processor.c
 Wed Jul 30 05:33:58 2008
@@ -372,8 +372,8 @@
     axis2_bool_t add_rec_side_term = AXIS2_FALSE;
     axis2_char_t *out_seq_id = NULL;
     
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Entry:sandesha2_"\
-        "terminate_seq_msg_processor_setup_highest_msg_nums");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] 
Entry:sandesha2_terminate_seq_msg_processor_setup_highest_msg_nums");
     AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
@@ -388,84 +388,115 @@
         SANDESHA2_SEQ_PROP_HIGHEST_IN_MSG_ID, seq_prop_mgr);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"[sandesha2]highest_in_msg_num_str:%s",
         highest_in_msg_num_str);
+
     if(highest_in_msg_num_str)
     {
         if(!highest_in_msg_id)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] "
-                "highest in msg id has not been stored");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "[sandesha2] highest in msg id has not been stored");
             if(highest_in_msg_num_str)
+            {
                 AXIS2_FREE(env->allocator, highest_in_msg_num_str);
+            }
+
             return AXIS2_FAILURE;
         }
+
         highest_in_msg_num = atol(highest_in_msg_num_str);
         if(highest_in_msg_num_str)
+        {
             AXIS2_FREE(env->allocator, highest_in_msg_num_str);
+        }
     }
+
     rec_side_int_seq_id = sandesha2_utils_get_internal_sequence_id(env, 
seq_id);
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"[sandesha2]rec_side_int_seq_id:%s", 
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] 
rec_side_int_seq_id:%s", 
         rec_side_int_seq_id);
+
     if(0 == highest_in_msg_num)
+    {
         add_rec_side_term = AXIS2_FALSE;
+    }
     else
     {
         /* Mark up the highest inbound message as if it had the last message 
          * flag on it.*/
         sandesha2_seq_property_bean_t *last_in_msg_bean = NULL;
         axis2_char_t *highest_out_relates_to = NULL;
-        last_in_msg_bean = sandesha2_seq_property_bean_create_with_data(env, 
-            seq_id, SANDESHA2_SEQ_PROP_LAST_IN_MESSAGE_ID, highest_in_msg_id);
+
+        last_in_msg_bean = sandesha2_seq_property_bean_create_with_data(env, 
seq_id, 
+                SANDESHA2_SEQ_PROP_LAST_IN_MESSAGE_ID, highest_in_msg_id);
+
         if(last_in_msg_bean)
         {
             sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, 
last_in_msg_bean);
+            sandesha2_seq_property_bean_free(last_in_msg_bean, env);
         }
+
         /* If an outbound message has already gone out with that relatesTo, 
then 
          * we can terminate right away.
          */
-        highest_out_relates_to = sandesha2_utils_get_seq_property(env, 
-            rec_side_int_seq_id, SANDESHA2_SEQ_PROP_HIGHEST_OUT_RELATES_TO, 
-            seq_prop_mgr);
-        if(highest_out_relates_to && 0 == 
axutil_strcmp(highest_out_relates_to, 
-            highest_in_msg_id))
+        highest_out_relates_to = sandesha2_utils_get_seq_property(env, 
rec_side_int_seq_id, 
+                SANDESHA2_SEQ_PROP_HIGHEST_OUT_RELATES_TO, seq_prop_mgr);
+
+        if(highest_out_relates_to && 0 == 
axutil_strcmp(highest_out_relates_to, highest_in_msg_id))
         {
             axis2_char_t *highest_out_msg_num_str = NULL;
-            highest_out_msg_num_str = sandesha2_utils_get_seq_property(env, 
-                rec_side_int_seq_id, 
SANDESHA2_SEQ_PROP_HIGHEST_OUT_MSG_NUMBER, 
-                seq_prop_mgr);
+
+            highest_out_msg_num_str = sandesha2_utils_get_seq_property(env, 
rec_side_int_seq_id, 
+                    SANDESHA2_SEQ_PROP_HIGHEST_OUT_MSG_NUMBER, seq_prop_mgr);
             highest_out_msg_num = atol(highest_out_msg_num_str);
             add_rec_side_term = AXIS2_TRUE;
             if(highest_out_msg_num_str)
+            {
                 AXIS2_FREE(env->allocator, highest_out_msg_num_str);
+            }
         }
+
         if(highest_out_relates_to)
+        {
             AXIS2_FREE(env->allocator, highest_out_relates_to);
         }
+    }
+
     if(highest_in_msg_id)
+    {
         AXIS2_FREE(env->allocator, highest_in_msg_id);
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]add_rec_side_term:%d",
-        add_rec_side_term);
+    }
+
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]add_rec_side_term:%d", 
add_rec_side_term);
     out_seq_id = sandesha2_utils_get_seq_property(env, rec_side_int_seq_id,
         SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID, seq_prop_mgr);
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]out_seq_id:%s",
-        out_seq_id);
-    if(add_rec_side_term && highest_out_msg_num > 0 &&
-        rec_side_int_seq_id && out_seq_id)
+
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]out_seq_id:%s", 
out_seq_id);
+
+    if(add_rec_side_term && highest_out_msg_num > 0 && rec_side_int_seq_id && 
out_seq_id)
     {
         axis2_bool_t all_acked = AXIS2_FALSE;
-        all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, 
-            highest_out_msg_num, rec_side_int_seq_id, seq_prop_mgr);
+
+        all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, 
highest_out_msg_num, 
+                rec_side_int_seq_id, seq_prop_mgr);
         if(!all_acked)
-        all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, 
-            highest_out_msg_num, out_seq_id, seq_prop_mgr);
-        if(all_acked)
         {
-            sandesha2_terminate_mgr_send_terminate_seq_msg(env, rm_msg_ctx,
-                out_seq_id, rec_side_int_seq_id, storage_mgr, seq_prop_mgr,
-                create_seq_mgr, sender_mgr);
+            all_acked = sandesha2_utils_is_all_msgs_acked_upto(env, 
highest_out_msg_num, out_seq_id, 
+                    seq_prop_mgr);
         }
-    }        
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Exit:sandesha2_"\
-        "terminate_seq_msg_processor_setup_highest_msg_nums");
+        else
+        {
+            sandesha2_terminate_mgr_send_terminate_seq_msg(env, rm_msg_ctx, 
out_seq_id, 
+                    rec_side_int_seq_id, storage_mgr, seq_prop_mgr, 
create_seq_mgr, sender_mgr);
+        }
+    }
+
+    if(rec_side_int_seq_id)
+    {
+        AXIS2_FREE(env->allocator, rec_side_int_seq_id);
+    }
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            
"[sandesha2]Exit:sandesha2_terminate_seq_msg_processor_setup_highest_msg_nums");
+
     return AXIS2_SUCCESS;    
 }
 

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
 Wed Jul 30 05:33:58 2008
@@ -259,13 +259,13 @@
     
sandesha2_permanent_bean_mgr_insert_msg_store_bean(storage_mgr_impl->bean_mgr, 
env, 
             msg_store_bean);
 
-    if(property && store_in_memory)
+    /*if(property && store_in_memory)
     {
         axutil_hash_t *msg_ctx_map = NULL;
         msg_ctx_map = axutil_property_get_value(property, env);
         axutil_hash_set(msg_ctx_map, axutil_strdup(env, key),
             AXIS2_HASH_KEY_STRING, msg_ctx);
-    }
+    }*/
 
     if(msg_store_bean)
     {
@@ -397,7 +397,7 @@
     sandesha2_msg_store_bean_t *msg_store_bean = NULL;
 
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
-    if(!persistent)
+    /*if(!persistent)
     {
         axutil_property_t *property = NULL;
         axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
@@ -415,7 +415,7 @@
     if(msg_ctx)
     {
         return msg_ctx;
-    }
+    }*/
 
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Message context 
retrieved from database");
 
@@ -565,7 +565,7 @@
     }
 
     op = axis2_msg_ctx_get_op(msg_ctx, env);
-    if(op)
+    /*if(op)
     {
                axis2_op_ctx_t *op_ctx = NULL;
         axis2_svc_ctx_t *svc_ctx = axis2_msg_ctx_get_svc_ctx(msg_ctx, env);
@@ -578,7 +578,7 @@
             axis2_msg_ctx_set_op_ctx(msg_ctx, env, op_ctx);
             msg_id = (axis2_char_t *) axis2_msg_ctx_get_msg_id(msg_ctx, env);
         }
-    }
+    }*/
 
     axis2_msg_ctx_set_server_side(msg_ctx, env, 
         sandesha2_msg_store_bean_is_svr_side(msg_store_bean, env));
@@ -701,7 +701,7 @@
     {
         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;
+        return NULL;
     }
 
     xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, 

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/ack_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/ack_mgr.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/ack_mgr.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/ack_mgr.c
 Wed Jul 30 05:33:58 2008
@@ -53,6 +53,7 @@
     sandesha2_msg_ctx_t *ack_rm_msg = NULL;
     /*axiom_soap_envelope_t *soap_env = NULL;*/
     axis2_op_ctx_t *op_ctx = NULL;
+    axis2_char_t *uuid = NULL;
     
     AXIS2_PARAM_CHECK(env->error, seq_id, NULL);
     AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
@@ -92,7 +93,14 @@
     ack_rm_msg = sandesha2_msg_init_init_msg(env, ack_msg_ctx);
     sandesha2_msg_ctx_set_rm_ns_val(ack_rm_msg, env, 
         sandesha2_msg_ctx_get_rm_ns_val(ref_rm_msg, env));
-    axis2_msg_ctx_set_wsa_message_id(ack_msg_ctx, env, axutil_uuid_gen(env));
+
+    uuid = axutil_uuid_gen(env);
+    if(uuid)
+    {
+        axis2_msg_ctx_set_wsa_message_id(ack_msg_ctx, env, uuid);
+        AXIS2_FREE(env->allocator, uuid);
+    }
+
     /*soap_env = axiom_soap_envelope_create_default_soap_envelope(env, 
      * sandesha2_utils_get_soap_version(env, 
axis2_msg_ctx_get_soap_envelope(ref_msg, env)));
     axis2_msg_ctx_set_soap_envelope(ack_msg_ctx, env, soap_env);*/
@@ -269,7 +277,6 @@
     axis2_msg_ctx_t *target_msg_ctx = NULL;
     axis2_endpoint_ref_t *to_epr = NULL;
     axutil_array_list_t *found_list = NULL;
-    int i = 0;
     
     AXIS2_PARAM_CHECK(env->error, target_rm_msg_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FAILURE);
@@ -294,63 +301,88 @@
         sandesha2_sender_bean_free(find_bean, env);
     }
 
-    for(i = 0; i < axutil_array_list_size(found_list, env); i++)
+    if(found_list)
     {
-        sandesha2_sender_bean_t *sender_bean = NULL;
-        long timenow = 0;
-        
-        timenow = sandesha2_utils_get_current_time_in_millis(env);
-        sender_bean = axutil_array_list_get(found_list, env, i);
-        
-        if(sandesha2_sender_bean_get_time_to_send(sender_bean, env) <= timenow)
+        int i = 0, size = 0;
+
+        size = axutil_array_list_size(found_list, env);
+        for(i = 0; i < size; i++)
         {
-            axis2_msg_ctx_t *ack_msg_ctx = NULL;
-            axis2_char_t *to = NULL;
-            sandesha2_msg_ctx_t *ack_rm_msg_ctx = NULL;
-            sandesha2_seq_ack_t *seq_ack = NULL;
-            axis2_char_t *msg_ctx_ref_key = NULL;
-            axis2_endpoint_ref_t *to_ref = NULL;
+            sandesha2_sender_bean_t *sender_bean = NULL;
+            long timenow = 0;
             
-            msg_ctx_ref_key = 
sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean, env);
-            ack_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, 
env, msg_ctx_ref_key, 
-                    conf_ctx, AXIS2_FALSE);
-
-            if(ack_msg_ctx)
+            timenow = sandesha2_utils_get_current_time_in_millis(env);
+            sender_bean = axutil_array_list_get(found_list, env, i);
+            
+            if(sandesha2_sender_bean_get_time_to_send(sender_bean, env) <= 
timenow)
             {
-                to_ref = axis2_msg_ctx_get_to(ack_msg_ctx, env);
-            }
+                axis2_msg_ctx_t *ack_msg_ctx = NULL;
+                axis2_char_t *to = NULL;
+                sandesha2_msg_ctx_t *ack_rm_msg_ctx = NULL;
+                sandesha2_seq_ack_t *seq_ack = NULL;
+                axis2_char_t *msg_ctx_ref_key = NULL;
+                axis2_endpoint_ref_t *to_ref = NULL;
+                
+                msg_ctx_ref_key = 
sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean, env);
+                ack_msg_ctx = 
sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env, msg_ctx_ref_key, 
+                        conf_ctx, AXIS2_FALSE);
 
-            if(to_ref)
-            {
-                to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_ref, 
env);
-            }
-            else
-            {
                 if(ack_msg_ctx)
                 {
-                    axis2_msg_ctx_free(ack_msg_ctx, env);
+                    to_ref = axis2_msg_ctx_get_to(ack_msg_ctx, env);
                 }
-                continue;
-            }
 
-            if(axutil_strcmp(to, to_str))
-            {
-                if(ack_msg_ctx)
+                if(to_ref)
                 {
-                    axis2_msg_ctx_free(ack_msg_ctx, env);
+                    to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_ref, 
env);
+                }
+                else
+                {
+                    if(ack_msg_ctx)
+                    {
+                        axis2_msg_ctx_free(ack_msg_ctx, env);
+                    }
+                    continue;
+                }
+
+                if(axutil_strcmp(to, to_str))
+                {
+                    if(ack_msg_ctx)
+                    {
+                        axis2_msg_ctx_free(ack_msg_ctx, env);
+                    }
+                    continue; 
                 }
-                continue; 
-            }
 
-            sandesha2_sender_mgr_remove(sender_mgr, env, 
sandesha2_sender_bean_get_msg_id(
-                        sender_bean, env));
+                sandesha2_sender_mgr_remove(sender_mgr, env, 
sandesha2_sender_bean_get_msg_id(
+                            sender_bean, env));
 
-            sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env, 
msg_ctx_ref_key, conf_ctx, -1);
-            ack_rm_msg_ctx = sandesha2_msg_init_init_msg(env, ack_msg_ctx);
+                sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env, 
msg_ctx_ref_key, conf_ctx, -1);
+                ack_rm_msg_ctx = sandesha2_msg_init_init_msg(env, ack_msg_ctx);
+
+                if(SANDESHA2_MSG_TYPE_ACK != 
sandesha2_msg_ctx_get_msg_type(ack_rm_msg_ctx, env))
+                {
+                    AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI, "[sandesha2] 
Invalid ack message entry");
+                    if(ack_msg_ctx)
+                    {
+                        axis2_msg_ctx_free(ack_msg_ctx, env);
+                    }
+
+                    if(ack_rm_msg_ctx)
+                    {
+                        sandesha2_msg_ctx_free(ack_rm_msg_ctx, env);
+                    }
+
+                    continue;
+                }
+
+                seq_ack = sandesha2_msg_ctx_get_seq_ack(ack_rm_msg_ctx, env);
+                /* When we set seq_ack to target rm message context taken from 
acknowledgment rm message 
+                 * context ,there happen freeing at both contexts if we do not 
increment ref.*/
+                sandesha2_seq_ack_increment_ref(seq_ack, env);
+                sandesha2_msg_ctx_set_seq_ack(target_rm_msg_ctx, env, seq_ack);
+                sandesha2_msg_ctx_add_soap_envelope(target_rm_msg_ctx, env);
 
-            if(SANDESHA2_MSG_TYPE_ACK != 
sandesha2_msg_ctx_get_msg_type(ack_rm_msg_ctx, env))
-            {
-                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Invalid 
ack message entry");
                 if(ack_msg_ctx)
                 {
                     axis2_msg_ctx_free(ack_msg_ctx, env);
@@ -361,28 +393,16 @@
                     sandesha2_msg_ctx_free(ack_rm_msg_ctx, env);
                 }
 
-                return AXIS2_FAILURE;
+                break;
             }
 
-            seq_ack = sandesha2_msg_ctx_get_seq_ack(ack_rm_msg_ctx, env);
-            /* When we set seq_ack to target rm message context taken from 
acknowledgment rm message 
-             * context ,there happen freeing at both contexts if we do not 
increment ref.*/
-            sandesha2_seq_ack_increment_ref(seq_ack, env);
-            sandesha2_msg_ctx_set_seq_ack(target_rm_msg_ctx, env, seq_ack);
-            sandesha2_msg_ctx_add_soap_envelope(target_rm_msg_ctx, env);
-
-            if(ack_msg_ctx)
+            if(sender_bean)
             {
-                axis2_msg_ctx_free(ack_msg_ctx, env);
+                sandesha2_sender_bean_free(sender_bean, env);
             }
-
-            if(ack_rm_msg_ctx)
-            {
-                sandesha2_msg_ctx_free(ack_rm_msg_ctx, env);
-            }
-
-            break;
         }
+
+        axutil_array_list_free(found_list, env);
     }
 
     return AXIS2_SUCCESS;

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
 Wed Jul 30 05:33:58 2008
@@ -535,7 +535,6 @@
     axis2_char_t *rm_version = NULL;
     axis2_char_t *rm_ns_value = NULL;
     axis2_bool_t is_seq_res_reqd = AXIS2_FALSE;
-    axiom_soap_envelope_t *envelope = NULL;
     axiom_soap_envelope_t *temp_envelope = NULL;
     sandesha2_msg_ctx_t *terminate_rm_msg = NULL;
     sandesha2_terminate_seq_t *terminate_seq = NULL;
@@ -596,8 +595,6 @@
     AXIS2_FREE(env->allocator, temp_msg_id);
     temp_envelope = sandesha2_msg_ctx_get_soap_envelope(ref_rm_msg, env);
     soap_version = sandesha2_utils_get_soap_version(env, temp_envelope);
-    envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
soap_version);
-    sandesha2_msg_ctx_set_soap_envelope(terminate_rm_msg, env, envelope);
 
     terminate_seq = sandesha2_terminate_seq_create(env, rm_ns_value);
     identifier = sandesha2_identifier_create(env, rm_ns_value);
@@ -968,8 +965,13 @@
         AXIS2_FREE(env->allocator, rm_version);
     }
 
-    ack_req_soap_action = axutil_string_create(env, temp_action); 
-    sandesha2_msg_ctx_set_soap_action(target_rm_msg_ctx, env, 
ack_req_soap_action); 
+    ack_req_soap_action = axutil_string_create(env, temp_action);
+    if(ack_req_soap_action)
+    {
+        sandesha2_msg_ctx_set_soap_action(target_rm_msg_ctx, env, 
ack_req_soap_action); 
+        axutil_string_free(ack_req_soap_action, env);
+    }
+
     uuid = axutil_uuid_gen(env);
     sandesha2_msg_ctx_set_msg_id(target_rm_msg_ctx, env, uuid);
 

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_retrans_adjuster.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_retrans_adjuster.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_retrans_adjuster.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_retrans_adjuster.c
 Wed Jul 30 05:33:58 2008
@@ -127,6 +127,11 @@
         continue_sending = AXIS2_FALSE;
     }
 
+    if(msg_ctx)
+    {
+        axis2_msg_ctx_free(msg_ctx, env);
+    }
+
     if(rm_msg_ctx)
     {
         sandesha2_msg_ctx_free(rm_msg_ctx, env);

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
 Wed Jul 30 05:33:58 2008
@@ -509,7 +509,6 @@
     const axutil_env_t *env,
     sandesha2_msg_ctx_t *ref_rm_msg)
 {
-    /*axis2_ctx_t *ctx = NULL;*/
     axis2_msg_ctx_t *ref_msg = NULL;
     axis2_msg_ctx_t *new_msg = NULL;
     axis2_conf_ctx_t *conf_ctx = NULL;
@@ -552,16 +551,6 @@
     axis2_msg_ctx_set_svc_ctx(new_msg, env, axis2_msg_ctx_get_svc_ctx(ref_msg, 
env));
     axis2_msg_ctx_set_svc_grp_ctx(new_msg, env, 
axis2_msg_ctx_get_svc_grp_ctx(ref_msg, env));
 
-    /*ctx = axis2_msg_ctx_get_base(ref_msg, env);
-    if (ctx)
-    {
-        axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(new_msg, env);
-        if (new_ctx)
-        {
-            axis2_ctx_set_property_map(new_ctx, env, 
axis2_ctx_get_property_map(ctx, env));
-        }
-    }*/
-
     soap_env = axiom_soap_envelope_create_default_soap_envelope(env, 
             sandesha2_utils_get_soap_version(env, 
axis2_msg_ctx_get_soap_envelope(ref_msg, env)));
 

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
 Wed Jul 30 05:33:58 2008
@@ -275,6 +275,8 @@
                     sandesha2_next_msg_mgr_remove(next_msg_mgr, env, seq_id);
                 }
             }
+            
+            sandesha2_next_msg_bean_free(bean, env);
         }
 
         axutil_array_list_free(found_list, env);
@@ -388,6 +390,8 @@
 
                 sandesha2_seq_property_mgr_remove(seq_prop_mgr, env, seq_id, 
name);
             }
+            
+            sandesha2_seq_property_bean_free(seq_prop_bean, env);
         }
 
         axutil_array_list_free(found_list, env);
@@ -423,7 +427,11 @@
     seq_term_bean = sandesha2_seq_property_bean_create_with_data(env, 
         internal_sequence_id, SANDESHA2_SEQ_PROP_SEQ_TERMINATED, 
AXIS2_VALUE_TRUE);
 
-    sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, seq_term_bean);
+    if(seq_term_bean)
+    {
+        sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, seq_term_bean);
+        sandesha2_seq_property_bean_free(seq_term_bean, env);
+    }
     
     sandesha2_terminate_mgr_clean_sending_side_data(env, conf_ctx, 
internal_sequence_id, 
         svr_side, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
@@ -881,7 +889,12 @@
 
     temp_action = 
sandesha2_spec_specific_consts_get_terminate_seq_soap_action(env, rm_ver);
     soap_action = axutil_string_create(env, temp_action);
-    sandesha2_msg_ctx_set_soap_action(terminate_rm_msg_ctx, env, soap_action);
+    if(soap_action)
+    {
+        sandesha2_msg_ctx_set_soap_action(terminate_rm_msg_ctx, env, 
soap_action);
+        axutil_string_free(soap_action, env);
+    }
+
     transport_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
internal_sequence_id, 
             SANDESHA2_SEQ_PROP_TRANSPORT_TO);
 
@@ -1080,17 +1093,29 @@
                     }
                 }
 
-                status = 
sandesha2_terminate_mgr_process_terminate_msg_response(env, terminate_msg_ctx, 
storage_mgr);
-                if(AXIS2_SUCCESS != status)
+                res_envelope = 
axis2_msg_ctx_get_response_soap_envelope(terminate_msg_ctx, env);
+                if(!res_envelope)
                 {
-                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                        "[sandesha2] Terminate message response process failed 
for sequence %s", 
-                        internal_sequence_id);
+                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] 
Response envelope not found");
 
-                    break;
+                    res_envelope = (axiom_soap_envelope_t *) 
axis2_http_transport_utils_create_soap_msg(env, 
+                            terminate_msg_ctx, soap_ns_uri);
                 }
+                
+                if(res_envelope)
+                {
+                    status = 
sandesha2_terminate_mgr_process_terminate_msg_response(env, 
+                            terminate_msg_ctx, storage_mgr);
 
-                res_envelope = 
axis2_msg_ctx_get_response_soap_envelope(terminate_msg_ctx, env);
+                    if(AXIS2_SUCCESS != status)
+                    {
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                            "[sandesha2] Terminate message response process 
failed for sequence %s", 
+                            internal_sequence_id);
+
+                        break;
+                    }
+                }
             }
 
             sandesha2_seq_property_bean_free(replay_bean, env);
@@ -1210,6 +1235,7 @@
             axis2_engine_free(engine, env);
     }
 
+    axis2_msg_ctx_set_paused(response_msg_ctx, env, AXIS2_FALSE);
     axis2_msg_ctx_free(response_msg_ctx, env);
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/msg_number.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/msg_number.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/msg_number.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/msg_number.c
 Wed Jul 30 05:33:58 2008
@@ -160,7 +160,8 @@
     axiom_namespace_t *rm_ns = NULL;
     axiom_element_t *mn_element = NULL;
     axiom_node_t *mn_node = NULL;
-    axis2_char_t *str_num = NULL;
+    /*axis2_char_t *str_num = NULL;*/
+    axis2_char_t str_num[32];
     
     AXIS2_PARAM_CHECK(env->error, om_node, NULL);
     
@@ -182,7 +183,8 @@
     {
         return NULL;
     }
-    str_num = AXIS2_MALLOC(env->allocator, 32*sizeof(axis2_char_t));
+
+    /*str_num = AXIS2_MALLOC(env->allocator, 32 * sizeof(axis2_char_t));*/
     sprintf(str_num, "%ld", msg_number->msg_num);
     axiom_element_set_text(mn_element, env, str_num, mn_node);
     axiom_node_add_child((axiom_node_t*)om_node, env, mn_node);

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/seq_ack.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/seq_ack.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/seq_ack.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/seq_ack.c
 Wed Jul 30 05:33:58 2008
@@ -504,7 +504,7 @@
     axiom_soap_envelope_t *envelope)
 {
     axiom_soap_header_t *soap_header = NULL;
-    axutil_qname_t *seq_ack_qname = NULL;
+    /*axutil_qname_t *seq_ack_qname = NULL;*/
     
     AXIS2_PARAM_CHECK(env->error, envelope, AXIS2_FAILURE);
     
@@ -512,7 +512,7 @@
     /**
      * Remove if old exists
      */
-    seq_ack_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_SEQ_ACK, 
seq_ack->ns_val, NULL);
+    /*seq_ack_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_SEQ_ACK, 
seq_ack->ns_val, NULL);
     if(!seq_ack_qname)
     {
         return AXIS2_FAILURE;
@@ -522,7 +522,7 @@
     if(seq_ack_qname)
     {
         axutil_qname_free(seq_ack_qname, env);
-    }
+    }*/
 
     sandesha2_seq_ack_to_om_node(seq_ack, env, soap_header);
 

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/sequence.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/sequence.c?rev=680999&r1=680998&r2=680999&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/sequence.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/sequence.c
 Wed Jul 30 05:33:58 2008
@@ -192,25 +192,28 @@
             AXIS2_FAILURE);
         return NULL;
     }
-    rm_ns = axiom_namespace_create(env, seq->ns_val,
-        SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
-    if(!rm_ns)
+    rm_ns = axiom_namespace_create(env, seq->ns_val, 
SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+    if(rm_ns)
     {
-        return NULL;
+        seq_block = axiom_soap_header_add_header_block(soap_header, env, 
SANDESHA2_WSRM_COMMON_SEQ, 
+                rm_ns);
+        axiom_namespace_free(rm_ns, env);
     }
-    seq_block = axiom_soap_header_add_header_block(soap_header, env, 
-        SANDESHA2_WSRM_COMMON_SEQ, rm_ns);
+
     if(!seq_block)
     {
         return NULL;
     }
-    axiom_soap_header_block_set_must_understand_with_bool(seq_block, env, 
-         seq->must_understand);
+
+    axiom_soap_header_block_set_must_understand_with_bool(seq_block, env, 
seq->must_understand);
     seq_node = axiom_soap_header_block_get_base_node(seq_block, env);
     sandesha2_identifier_to_om_node(seq->identifier, env, seq_node);
     sandesha2_msg_number_to_om_node(seq->msg_num, env, seq_node);
     if(seq->last_msg)
+    {
         sandesha2_last_msg_to_om_node(seq->last_msg, env, seq_node);
+    }
+
     return seq_node;
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to