You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/08/30 07:30:42 UTC

svn commit: r690466 - in /webservices/sandesha/trunk/c: config/module.xml include/sandesha2_client.h src/client/client.c src/msgprocessors/close_seq_msg_processor.c src/util/msg_creator.c src/util/msg_init.c src/wsrm/close_seq_res.c src/wsrm/rm_elements.c

Author: damitha
Date: Fri Aug 29 22:30:41 2008
New Revision: 690466

URL: http://svn.apache.org/viewvc?rev=690466&view=rev
Log:
Close sequence functionality is implemented

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/include/sandesha2_client.h
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/util/msg_creator.c
    webservices/sandesha/trunk/c/src/util/msg_init.c
    webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c
    webservices/sandesha/trunk/c/src/wsrm/rm_elements.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Fri Aug 29 22:30:41 2008
@@ -44,23 +44,26 @@
         <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested</actionMapping>
         <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</actionMapping>
 
-        <!-- namespaces for the 2006-08 spec -->
+        <!-- namespaces for the 2007-02 spec -->
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknowledgement</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequenceResponse</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/AckRequested</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequence</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequenceResponse</actionMapping>
         
      </operation>
  
      <operation name="RMInOutOperation" mep="http://www.w3.org/2004/08/wsdl/in-out">
         <!-- namespaces for the 2005-02 spec -->
         <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</actionMapping>
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</actionMapping>
 
-        <!-- namespaces for the 2006-08 spec -->
+        <!-- namespaces for the 2007-02 spec -->
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequence</actionMapping>
-        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequenceResponse</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse</actionMapping>
         <actionMapping>http://docs.oasis-open.org/ws-rx/wsmc/200702/MakeConnection</actionMapping>
         
 

Modified: webservices/sandesha/trunk/c/include/sandesha2_client.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_client.h?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_client.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_client.h Fri Aug 29 22:30:41 2008
@@ -128,7 +128,8 @@
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 sandesha2_client_close_seq_with_svc_client(
     const axutil_env_t *env,
-    axis2_svc_client_t *svc_client);
+    axis2_svc_client_t *svc_client,
+    axis2_callback_t *callback);
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 sandesha2_client_close_seq_with_svc_client_and_seq_key(

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Fri Aug 29 22:30:41 2008
@@ -775,12 +775,13 @@
     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);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_OPTIONS_OBJECT_NOT_SET, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
+
     old_property = (axutil_property_t *) axis2_options_get_property(options, env, 
         SANDESHA2_CLIENT_SEQ_KEY);
+
     property = axutil_property_create_with_args(env, 0, 0, 0, seq_key);
     axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, property);
     sandesha2_client_terminate_seq_with_svc_client(env, svc_client, NULL);
@@ -795,8 +796,9 @@
  */
 axis2_status_t AXIS2_CALL
 sandesha2_client_close_seq_with_svc_client(
-        const axutil_env_t *env,
-        axis2_svc_client_t *svc_client)
+    const axutil_env_t *env,
+    axis2_svc_client_t *svc_client,
+    axis2_callback_t *callback)
 {
     axis2_svc_ctx_t *svc_ctx = NULL;
     axis2_options_t *options = NULL;
@@ -813,7 +815,10 @@
     axiom_element_t *element = NULL;
     axutil_qname_t *qname = NULL;
     axutil_property_t *property = NULL;
-    
+   
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Entry:sandesha2_client_close_seq_with_svc_client");
+
     svc_ctx = (axis2_svc_ctx_t *) axis2_svc_client_get_svc_ctx(svc_client, env);
     if(!svc_ctx)
     {
@@ -860,7 +865,8 @@
     action = sandesha2_spec_specific_consts_get_close_seq_action(env, rm_spec_version);
     axis2_options_set_action(options, env, action);
 
-    axis2_svc_client_fire_and_forget(svc_client, env, close_body_node);
+    sandesha2_client_fire_and_forget(env, svc_client, options, NULL, callback, close_body_node);
+    /*axis2_svc_client_fire_and_forget(svc_client, env, close_body_node);*/
     if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_COULD_NOT_SEND_THE_CLOSE_SEQ_MESSAGE, 
@@ -871,6 +877,10 @@
     }
 
     axis2_options_set_action(options, env, old_action);
+    
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Exit:sandesha2_client_close_seq_with_svc_client");
+
     return AXIS2_SUCCESS;
 }
 
@@ -881,36 +891,32 @@
     axis2_char_t *seq_key)
 {
     axis2_options_t *options = NULL;
-    axis2_char_t *spec_version = NULL;
     axutil_property_t *property = NULL;
     axutil_property_t *old_property = NULL;
     
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Entry:sandesha2_client_close_seq_with_svc_client_and_seq_key");
+
     options = (axis2_options_t *) axis2_svc_client_get_options(svc_client, env);
     if(!options)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] Options struct is not set in the service client");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_OPTIONS_OBJECT_NOT_SET, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
-    spec_version = (axis2_char_t *) axis2_options_get_property(options, env, 
-            SANDESHA2_CLIENT_RM_SPEC_VERSION);
-
-    if(axutil_strcmp(SANDESHA2_SPEC_VERSION_1_1, spec_version))
-    {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CLOSE_SEQ_FEATURE_ONLY_AVAILABLE_FOR_WSRM1_1, 
-            AXIS2_FAILURE);
-
-        return AXIS2_FAILURE;
-    }
-
     old_property = (axutil_property_t *) axis2_options_get_property(options, env, 
         SANDESHA2_CLIENT_SEQ_KEY);
 
     property = axutil_property_create_with_args(env, 0, 0, 0, seq_key);
     axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, property);
-    sandesha2_client_close_seq_with_svc_client(env, svc_client);
+    sandesha2_client_close_seq_with_svc_client(env, svc_client, NULL);
     axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, old_property);
 
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Exit:sandesha2_client_close_seq_with_svc_client_and_seq_key");
+
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c Fri Aug 29 22:30:41 2008
@@ -18,9 +18,11 @@
 #include <sandesha2_storage_mgr.h>
 #include <sandesha2_seq_property_mgr.h>
 #include <sandesha2_create_seq_mgr.h>
+#include <sandesha2_sender_mgr.h>
 #include <sandesha2_next_msg_mgr.h>
 #include <sandesha2_permanent_seq_property_mgr.h>
 #include <sandesha2_permanent_create_seq_mgr.h>
+#include <sandesha2_permanent_sender_mgr.h>
 #include <sandesha2_permanent_next_msg_mgr.h>
 #include <sandesha2_fault_mgr.h>
 #include <sandesha2_constants.h>
@@ -44,6 +46,7 @@
 #include <axis2_core_utils.h>
 #include <sandesha2_ack_mgr.h>
 #include <sandesha2_msg_creator.h>
+#include <sandesha2_client_constants.h>
 
 /** 
  * @brief Close Sequence Message Processor struct impl
@@ -66,6 +69,13 @@
     sandesha2_msg_ctx_t *rm_msg_ctx);
     
 static axis2_status_t
+sandesha2_close_seq_msg_processor_add_close_seq_res(
+    const axutil_env_t *env, 
+    sandesha2_msg_ctx_t *rm_msg_ctx,
+    axis2_char_t *seq_id,
+    sandesha2_seq_property_mgr_t *seq_prop_mgr);
+
+static axis2_status_t
 sandesha2_close_seq_msg_processor_process_out_msg(
     sandesha2_msg_processor_t *msg_processor,
     const axutil_env_t *env, 
@@ -148,17 +158,11 @@
     axis2_char_t *seq_id = NULL;
     sandesha2_msg_ctx_t *fault_rm_msg_ctx = NULL;
     sandesha2_seq_property_bean_t *close_seq_bean = NULL;
-    axis2_msg_ctx_t *ack_msg_ctx = NULL;
-    sandesha2_msg_ctx_t *ack_rm_msg = NULL;
-    axis2_char_t *rm_ns_val = NULL;
-    axiom_soap_envelope_t *envelope = NULL;
-    sandesha2_seq_ack_t *seq_ack  = NULL;
-    axis2_msg_ctx_t *close_seq_res_msg = NULL;
-    sandesha2_msg_ctx_t *close_seq_res_rm_msg = NULL;
-    axutil_property_t *property = NULL;
-    axis2_engine_t *engine = NULL;
     axis2_char_t *dbname = NULL;
     
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
+        "[sandesha2] Entry:sandesha2_close_seq_msg_processor_process_in_msg");
+
     AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
     
     msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
@@ -179,6 +183,8 @@
 
     if(fault_rm_msg_ctx)
     {
+        axis2_engine_t *engine = NULL;
+
         engine = axis2_engine_create(env, conf_ctx);
 
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]axis2_engine_send");
@@ -220,72 +226,312 @@
     sandesha2_seq_property_bean_set_value(close_seq_bean, env, AXIS2_VALUE_TRUE);
     
     sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, close_seq_bean);
-    ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id, seq_prop_mgr);
-    ack_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
-    rm_ns_val = sandesha2_msg_ctx_get_rm_ns_val(rm_msg_ctx, env);
-    sandesha2_msg_ctx_set_rm_ns_val(ack_rm_msg, env, rm_ns_val);
     
-    envelope = axiom_soap_envelope_create_default_soap_envelope(env,
-        sandesha2_utils_get_soap_version(env, axis2_msg_ctx_get_soap_envelope(msg_ctx, env)));
+    sandesha2_close_seq_msg_processor_add_close_seq_res(env, rm_msg_ctx, seq_id, seq_prop_mgr);
+    
+    axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
+
+    if(seq_prop_mgr)
+    {
+        sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+    }
 
-    axis2_msg_ctx_set_soap_envelope(ack_msg_ctx, env, envelope);
+    if(create_seq_mgr)
+    {
+        sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+    }
+
+    if(next_msg_mgr)
+    {
+        sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+    }
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
+        "[sandesha2] Exit:sandesha2_close_seq_msg_processor_process_in_msg");
+
+    return AXIS2_SUCCESS;
+}
     
-    seq_ack = sandesha2_msg_ctx_get_seq_ack(ack_rm_msg, env);
-    close_seq_res_msg = sandesha2_utils_create_out_msg_ctx(env, msg_ctx);
+static axis2_status_t
+sandesha2_close_seq_msg_processor_add_close_seq_res(
+    const axutil_env_t *env, 
+    sandesha2_msg_ctx_t *rm_msg_ctx,
+    axis2_char_t *seq_id,
+    sandesha2_seq_property_mgr_t *seq_prop_mgr)
+{
+    axis2_msg_ctx_t *msg_ctx = NULL;
+    axis2_msg_ctx_t *out_msg_ctx = NULL;
+    sandesha2_msg_ctx_t *out_rm_msg = NULL;
+    sandesha2_msg_ctx_t *ack_rm_msg = NULL;
+    sandesha2_seq_ack_t *seq_ack = NULL;
+    axutil_property_t *property = NULL;
+    axis2_engine_t *engine = NULL;
+    axis2_op_ctx_t *op_ctx = NULL;
+    axis2_endpoint_ref_t *to_epr = NULL;
+
+    AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Entry:sandesha2_close_seq_msg_processor_add_close_seq_res");
     
-    close_seq_res_rm_msg = sandesha2_msg_creator_create_close_seq_res_msg(env, rm_msg_ctx, 
-            close_seq_res_msg, seq_prop_mgr);
+    msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
+    out_msg_ctx = sandesha2_utils_create_out_msg_ctx(env, msg_ctx);
+    out_rm_msg = sandesha2_msg_creator_create_close_seq_res_msg(env, rm_msg_ctx, out_msg_ctx, 
+            seq_prop_mgr);
+
+    if(!out_rm_msg)
+    {
+        return AXIS2_FAILURE;
+    }
+
+    ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id, seq_prop_mgr);
+    if(ack_rm_msg)
+    {
+        seq_ack = sandesha2_msg_ctx_get_seq_ack(ack_rm_msg, env);
+        sandesha2_msg_ctx_set_seq_ack(out_rm_msg, env, seq_ack);
+    }
+
+    sandesha2_msg_ctx_add_soap_envelope(out_rm_msg, env);
+    sandesha2_msg_ctx_set_flow(out_rm_msg, env, AXIS2_OUT_FLOW);
     
-    sandesha2_msg_ctx_set_seq_ack(close_seq_res_rm_msg, env, seq_ack);
-    sandesha2_msg_ctx_set_flow(close_seq_res_rm_msg, env, AXIS2_OUT_FLOW);
     property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
-    sandesha2_msg_ctx_set_property(close_seq_res_rm_msg, env, 
-        SANDESHA2_APPLICATION_PROCESSING_DONE, property);
+    axis2_msg_ctx_set_property(out_msg_ctx, env, SANDESHA2_APPLICATION_PROCESSING_DONE, property);
 
-    /*AXIS2_MSG_CTX_SET_RESPONSE_WRITTEN(close_seq_res_msg, env, AXIS2_TRUE);*/
-    sandesha2_msg_ctx_add_soap_envelope(close_seq_res_rm_msg, env);
-    
-    engine = axis2_engine_create(env, conf_ctx);
+    engine = axis2_engine_create(env, axis2_msg_ctx_get_conf_ctx(msg_ctx, env));
 
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] axis2_engine_send");
-    axis2_engine_send(engine, env, close_seq_res_msg);
 
-    if(engine)
+    axis2_engine_send(engine, env, out_msg_ctx); 
+    op_ctx = axis2_msg_ctx_get_op_ctx(out_msg_ctx, env);
+    if(to_epr)
     {
-        axis2_engine_free(engine, env);
+        if(sandesha2_utils_is_anon_uri(env, axis2_endpoint_ref_get_address(to_epr, 
+            env)))
+        {
+            axis2_op_ctx_set_response_written(op_ctx, env, AXIS2_TRUE);
+        }
+        else
+        {
+            axis2_op_ctx_set_response_written(op_ctx, env, AXIS2_FALSE);
+        }
     }
-
-    if(seq_prop_mgr)
+    else
     {
-        sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+        axis2_op_ctx_set_response_written(op_ctx, env, AXIS2_TRUE);
     }
 
-    if(create_seq_mgr)
+    if(engine)
     {
-        sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+        axis2_engine_free(engine, env);
     }
 
-    if(next_msg_mgr)
+    if(out_rm_msg)
     {
-        sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+        sandesha2_msg_ctx_free(out_rm_msg, env);
     }
 
-    if(close_seq_res_rm_msg)
-    {
-        sandesha2_msg_ctx_free(close_seq_res_rm_msg, env);
-    }
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+            "[sandesha2] Exit:sandesha2_close_seq_msg_processor_add_close_seq_res");
 
     return AXIS2_SUCCESS;
 }
-    
+
+/**
+ * This function is invoked in RM 1.1 where client explicitly send the 
+ * close sequence message
+ */
 static axis2_status_t
 sandesha2_close_seq_msg_processor_process_out_msg(
     sandesha2_msg_processor_t *msg_processor,
     const axutil_env_t *env, 
     sandesha2_msg_ctx_t *rm_msg_ctx)
 {
+    axis2_msg_ctx_t *msg_ctx = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    sandesha2_storage_mgr_t *storage_mgr = NULL;
+    sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
+    sandesha2_create_seq_mgr_t *create_seq_mgr = NULL;
+    sandesha2_sender_mgr_t *sender_mgr = NULL;
+    axis2_char_t *to_address = NULL;
+    axis2_char_t *seq_key = NULL;
+    axis2_char_t *int_seq_id = NULL;
+    axis2_char_t *out_seq_id = NULL;
+    axutil_property_t *property = NULL;
+    axis2_op_t *old_op = NULL;
+    axis2_op_t *out_in_op = NULL;
+    axutil_qname_t *qname = NULL;
+    sandesha2_close_seq_t *close_seq_part = NULL;
+    axis2_char_t *rm_version = NULL;
+    axis2_char_t *transport_to = NULL;
+    axis2_char_t *temp_action = NULL;
+    axutil_string_t *soap_action = NULL;
+    axis2_char_t *dbname = NULL;
+    
     AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
+        "[sandesha2] Entry:sandesha2_close_seq_msg_processor_process_out_msg");
     
+    msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
+    conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+    
+    dbname = sandesha2_util_get_dbname(env, conf_ctx);
+    storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
+    seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
+    create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
+    sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
+    to_address = (axis2_char_t*)axis2_endpoint_ref_get_address(axis2_msg_ctx_get_to(msg_ctx, env), 
+            env);
+
+    property = axis2_msg_ctx_get_property(msg_ctx, env, SANDESHA2_CLIENT_SEQ_KEY);
+    if(property)
+    {
+        seq_key = axutil_property_get_value(property, env);
+    }
+
+    int_seq_id = sandesha2_utils_get_client_internal_sequence_id(env, to_address, seq_key);
+    out_seq_id = sandesha2_utils_get_seq_property(env, int_seq_id, 
+        SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID, seq_prop_mgr);
+
+    if(!out_seq_id)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] seq_id was not found. Cannot send the close sequence message");
+
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_FIND_SEQ_ID, AXIS2_FAILURE);
+        if(seq_prop_mgr)
+        {
+            sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+        }
+
+        if(create_seq_mgr)
+        {
+            sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+        }
+
+        if(sender_mgr)
+        {
+            sandesha2_sender_mgr_free(sender_mgr, env);
+        }
+
+        if(storage_mgr)
+        {
+            sandesha2_storage_mgr_free(storage_mgr, env);
+        }
+
+        return AXIS2_FAILURE;
+    }
+
+    old_op = axis2_msg_ctx_get_op(msg_ctx, env);
+    
+    qname = axutil_qname_create(env, "temp", NULL, NULL); 
+    out_in_op = axis2_op_create_with_qname(env, qname);
+    if(qname)
+    {
+        axutil_qname_free(qname, env);
+    }
+
+    axis2_op_set_msg_exchange_pattern(out_in_op, env, AXIS2_MEP_URI_OUT_IN);
+    axis2_op_set_in_flow(out_in_op, env, axis2_op_get_in_flow(old_op, env));
+
+    close_seq_part = sandesha2_msg_ctx_get_close_seq(rm_msg_ctx, env);
+    sandesha2_identifier_set_identifier(sandesha2_close_seq_get_identifier(close_seq_part, env), 
+            env, out_seq_id);
+
+    sandesha2_msg_ctx_set_flow(rm_msg_ctx, env, AXIS2_OUT_FLOW);
+    property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
+    axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_APPLICATION_PROCESSING_DONE, property);
+    axis2_msg_ctx_set_to(msg_ctx, env, axis2_endpoint_ref_create(env, to_address));
+    rm_version = sandesha2_utils_get_rm_version(env, int_seq_id, seq_prop_mgr);
+    if(!rm_version)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] Cant find the rm_version of the given message");
+
+        if(out_seq_id)
+        {
+            AXIS2_FREE(env->allocator, out_seq_id);
+        }
+
+        if(seq_prop_mgr)
+        {
+            sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+        }
+
+        if(create_seq_mgr)
+        {
+            sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+        }
+
+        if(sender_mgr)
+        {
+            sandesha2_sender_mgr_free(sender_mgr, env);
+        }
+
+        if(storage_mgr)
+        {
+            sandesha2_storage_mgr_free(storage_mgr, env);
+        }
+
+        return AXIS2_FAILURE;
+    }
+
+    axis2_msg_ctx_set_wsa_action(msg_ctx, env, 
+            sandesha2_spec_specific_consts_get_close_seq_action(env, rm_version));
+
+    temp_action = sandesha2_spec_specific_consts_get_close_seq_action(env, rm_version);
+    if(rm_version)
+    {
+        AXIS2_FREE(env->allocator, rm_version);
+    }
+
+    soap_action = axutil_string_create(env, temp_action);
+    axis2_msg_ctx_set_soap_action(msg_ctx, env, soap_action);
+    transport_to = sandesha2_utils_get_seq_property(env, int_seq_id, 
+        SANDESHA2_SEQ_PROP_TRANSPORT_TO, seq_prop_mgr);
+
+    if(transport_to)
+    {
+        axis2_msg_ctx_set_transport_url(msg_ctx, env, transport_to);
+        AXIS2_FREE(env->allocator, transport_to);
+    }
+
+    if(!sandesha2_util_is_ack_already_piggybacked(env, rm_msg_ctx))
+    {
+        sandesha2_ack_mgr_piggyback_acks_if_present(env, out_seq_id, rm_msg_ctx, storage_mgr, 
+                seq_prop_mgr, sender_mgr);
+    }
+
+    if(out_seq_id)
+    {
+        AXIS2_FREE(env->allocator, out_seq_id);
+    }
+
+    if(seq_prop_mgr)
+    {
+        sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+    }
+
+    if(create_seq_mgr)
+    {
+        sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+    }
+
+    if(sender_mgr)
+    {
+        sandesha2_sender_mgr_free(sender_mgr, env);
+    }
+
+    if(storage_mgr)
+    {
+        sandesha2_storage_mgr_free(storage_mgr, env);
+    }
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
+        "[sandesha2] Exit:sandesha2_close_seq_msg_processor_process_out_msg");
+
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Fri Aug 29 22:30:41 2008
@@ -494,7 +494,7 @@
     axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_msg_ctx_t *temp_msg_ctx = NULL;
     axis2_char_t *rm_version = NULL;
-    axis2_char_t *ns = NULL;
+    axis2_char_t *rm_ns_val = NULL;
     axis2_char_t *temp_action = NULL;
     axutil_string_t *soap_action = NULL;
     axis2_char_t *seq_id = NULL;
@@ -510,31 +510,29 @@
     close_seq_res_rm_msg_ctx = sandesha2_msg_ctx_create(env, out_msg);
     temp_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(close_seq_msg, env);
     conf_ctx = axis2_msg_ctx_get_conf_ctx(temp_msg_ctx, env);
-    cs = (sandesha2_close_seq_t *) sandesha2_msg_ctx_get_close_seq(
-        close_seq_msg, env);
+    cs = (sandesha2_close_seq_t *) sandesha2_msg_ctx_get_close_seq(close_seq_msg, env);
     temp_identifier = sandesha2_close_seq_get_identifier(cs, env);
     seq_id = sandesha2_identifier_get_identifier(temp_identifier, env);
-    ns = sandesha2_msg_ctx_get_rm_ns_val(close_seq_msg, env);
-    sandesha2_msg_ctx_set_rm_ns_val(close_seq_res_rm_msg_ctx, env, ns);
-    close_seq_res = sandesha2_close_seq_res_create(env, ns);
-    identifier = sandesha2_identifier_create(env, ns);
+    rm_ns_val = sandesha2_msg_ctx_get_rm_ns_val(close_seq_msg, env);
+    sandesha2_msg_ctx_set_rm_ns_val(close_seq_res_rm_msg_ctx, env, rm_ns_val);
+    close_seq_res = sandesha2_close_seq_res_create(env, rm_ns_val);
+    identifier = sandesha2_identifier_create(env, rm_ns_val);
     sandesha2_identifier_set_identifier(identifier, env, seq_id);
     sandesha2_close_seq_res_set_identifier(close_seq_res, env, identifier);
     temp_envelope = sandesha2_msg_ctx_get_soap_envelope(close_seq_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(close_seq_res_rm_msg_ctx, env, envelope);
-    sandesha2_msg_ctx_set_close_seq_res(close_seq_res_rm_msg_ctx, env, 
-        close_seq_res);
+    sandesha2_msg_ctx_set_close_seq_res(close_seq_res_rm_msg_ctx, env, close_seq_res);
     rm_version = sandesha2_utils_get_rm_version(env, seq_id, seq_prop_mgr);
-    temp_action = sandesha2_spec_specific_consts_get_close_seq_res_action(
-            env, rm_version);
+    temp_action = sandesha2_spec_specific_consts_get_close_seq_res_action(env, rm_version);
     axis2_msg_ctx_set_wsa_action(out_msg, env, temp_action);
-    temp_action = 
-        sandesha2_spec_specific_consts_get_close_seq_res_action(env, 
-                rm_version);
+    temp_action = sandesha2_spec_specific_consts_get_close_seq_res_action(env, rm_version);
     if(rm_version)
+    {
         AXIS2_FREE(env->allocator, rm_version);
+    }
+
     soap_action = axutil_string_create(env, temp_action);
     axis2_msg_ctx_set_soap_action(out_msg, env, soap_action);
 

Modified: webservices/sandesha/trunk/c/src/util/msg_init.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_init.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Fri Aug 29 22:30:41 2008
@@ -210,24 +210,23 @@
         rm_ns = sandesha2_ack_requested_get_namespace_value(
             ack_request, env);
     }
+
     close_seq = sandesha2_rm_elements_get_close_seq(rm_elements, env);
     if(close_seq)
     {
-        sandesha2_msg_ctx_set_close_seq(rm_msg_ctx, env, 
-            close_seq);
-        rm_ns = sandesha2_close_seq_get_namespace_value(
-                 close_seq, env);
+        sandesha2_msg_ctx_set_close_seq(rm_msg_ctx, env, close_seq);
+        rm_ns = sandesha2_close_seq_get_namespace_value(close_seq, env);
         add_op_if_null(env, msg_ctx);
     }
+
     close_seq_res = sandesha2_rm_elements_get_close_seq_res(rm_elements, env);
     if(close_seq_res)
     {
-        sandesha2_msg_ctx_set_close_seq_res(rm_msg_ctx, env, 
-            close_seq_res);
-        rm_ns = sandesha2_close_seq_res_get_namespace_value(
-                 close_seq_res, env);
+        sandesha2_msg_ctx_set_close_seq_res(rm_msg_ctx, env, close_seq_res);
+        rm_ns = sandesha2_close_seq_res_get_namespace_value(close_seq_res, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
+
     make_conn = sandesha2_rm_elements_get_make_connection(rm_elements, env);
     if(make_conn)
     {
@@ -235,6 +234,7 @@
         rm_ns = sandesha2_make_connection_get_namespace_value(make_conn, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
+
     msg_pending = sandesha2_rm_elements_get_msg_pending(rm_elements, env);
     if(msg_pending)
     {
@@ -242,6 +242,7 @@
         rm_ns = sandesha2_msg_pending_get_namespace_value(msg_pending, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
+
     sandesha2_msg_ctx_set_rm_ns_val(rm_msg_ctx, env, rm_ns);
     if(addressing_ns)
     {

Modified: webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c Fri Aug 29 22:30:41 2008
@@ -165,7 +165,7 @@
         return NULL;
     }
 
-    sandesha2_close_seq_res_to_om_node((sandesha2_close_seq_res_t *) close_seq_res->identifier, env, 
+    sandesha2_identifier_to_om_node((sandesha2_identifier_t *) close_seq_res->identifier, env, 
             csr_node);
 
     axiom_node_add_child((axiom_node_t*)om_node, env, csr_node);
@@ -212,7 +212,7 @@
      * Remove if old exists
      */
     close_seq_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE, 
-        close_seq_res->ns_val, NULL);
+        close_seq_res->ns_val, NULL);    
 
     if(!close_seq_qname)
     {

Modified: webservices/sandesha/trunk/c/src/wsrm/rm_elements.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/rm_elements.c?rev=690466&r1=690465&r2=690466&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/rm_elements.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/rm_elements.c Fri Aug 29 22:30:41 2008
@@ -226,44 +226,51 @@
     }
 
     qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, rm_ns_val, NULL);
-    close_seq_element = axiom_element_get_first_child_with_qname(body_element, 
-        env, qname, body_node, &close_seq_node);
+    close_seq_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &close_seq_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(close_seq_node)
     {
         rm_elements->close_seq = sandesha2_close_seq_create(env, rm_ns_val);
-        sandesha2_close_seq_from_om_node(
-            rm_elements->close_seq, env, close_seq_node);
+        sandesha2_close_seq_from_om_node(rm_elements->close_seq, env, close_seq_node);
     }
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE, 
-                        rm_ns_val, NULL);
-    close_seq_res_element = axiom_element_get_first_child_with_qname(
-        body_element, env, qname, body_node, &close_seq_res_node);
+
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ_RESPONSE, rm_ns_val, NULL);
+    close_seq_res_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &close_seq_res_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(close_seq_res_node)
     {
-        rm_elements->close_seq_res = sandesha2_close_seq_res_create(env, 
-            rm_ns_val);
-        sandesha2_close_seq_res_from_om_node(
-            rm_elements->close_seq_res, env, close_seq_res_node);
+        rm_elements->close_seq_res = sandesha2_close_seq_res_create(env, rm_ns_val);
+        sandesha2_close_seq_res_from_om_node(rm_elements->close_seq_res, env, close_seq_res_node);
     }
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_MAKE_CONNECTION, 
-        rm_ns_val, NULL);
-    make_conn_element = axiom_element_get_first_child_with_qname(body_element, 
-        env, qname, body_node, &make_conn_node);
+
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_MAKE_CONNECTION, rm_ns_val, NULL);
+    make_conn_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &make_conn_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(make_conn_node)
     {
-        rm_elements->make_connection = sandesha2_make_connection_create(env, 
-            rm_ns_val);
-        sandesha2_make_connection_from_om_node(
-            rm_elements->make_connection, env, make_conn_node);
+        rm_elements->make_connection = sandesha2_make_connection_create(env, rm_ns_val);
+        sandesha2_make_connection_from_om_node(rm_elements->make_connection, env, make_conn_node);
     }
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_ACK_REQUESTED, 
-                        rm_ns_val, NULL);
+
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_ACK_REQUESTED, rm_ns_val, NULL);
     ack_requested_element = axiom_element_get_first_child_with_qname(
         header_element, env, qname, header_node, &ack_requested_node);
     if(qname)



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