ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r690507 - in /webservices/sandesha/trunk/c: include/ src/client/ src/handlers/ src/msgprocessors/ src/util/ src/wsrm/
Date Sat, 30 Aug 2008 14:09:53 GMT
Author: damitha
Date: Sat Aug 30 07:09:52 2008
New Revision: 690507

URL: http://svn.apache.org/viewvc?rev=690507&view=rev
Log:
LastMsgNumber is now added into Terminate Sequence message

Added:
    webservices/sandesha/trunk/c/src/msgprocessors/close_seq_res_msg_processor.c
Modified:
    webservices/sandesha/trunk/c/include/sandesha2_client.h
    webservices/sandesha/trunk/c/include/sandesha2_terminate_seq.h
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
    webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am
    webservices/sandesha/trunk/c/src/msgprocessors/msg_processor_creator.c
    webservices/sandesha/trunk/c/src/util/msg_init.c
    webservices/sandesha/trunk/c/src/wsrm/close_seq.c
    webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c
    webservices/sandesha/trunk/c/src/wsrm/terminate_seq.c

Modified: webservices/sandesha/trunk/c/include/sandesha2_client.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_client.h?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_client.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_client.h Sat Aug 30 07:09:52 2008
@@ -112,13 +112,15 @@
 sandesha2_client_terminate_seq_with_svc_client(
     const axutil_env_t *env,
     axis2_svc_client_t *svc_client,
-    axis2_callback_t *callback);
+    axis2_callback_t *callback,
+    long last_msg_no);
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 sandesha2_client_terminate_seq_with_svc_client_and_seq_key(
     const axutil_env_t *env,
     axis2_svc_client_t *svc_client,
-    axis2_char_t *seq_key);
+    axis2_char_t *seq_key,
+    long last_msg_no);
 
 /**
  * User can close the seq defined by the passed svc_client.

Modified: webservices/sandesha/trunk/c/include/sandesha2_terminate_seq.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_terminate_seq.h?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_terminate_seq.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_terminate_seq.h Sat Aug 30 07:09:52 2008
@@ -25,6 +25,7 @@
 #include <axutil_utils_defines.h>
 #include <axutil_env.h>
 #include <sandesha2_identifier.h>
+#include <sandesha2_last_msg_number.h>
 #include <sandesha2_error.h>
 
 
@@ -94,6 +95,17 @@
     const axutil_env_t *env, 
     void *om_node);
  
+sandesha2_last_msg_number_t * AXIS2_CALL
+sandesha2_terminate_seq_get_last_msg_number(
+    sandesha2_terminate_seq_t *terminate_seq,
+    const axutil_env_t *env);
+
+axis2_status_t AXIS2_CALL                 
+sandesha2_terminate_seq_set_last_msg_number(
+    sandesha2_terminate_seq_t *terminate_seq,
+    const axutil_env_t *env, 
+    sandesha2_last_msg_number_t *last_msg_number);
+
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Sat Aug 30 07:09:52 2008
@@ -135,7 +135,8 @@
     const axutil_env_t *env,
     axis2_options_t *options, 
     axis2_conf_ctx_t *conf_ctx,
-    sandesha2_seq_property_mgr_t *seq_prop_mgr);
+    sandesha2_seq_property_mgr_t *seq_prop_mgr,
+    long last_msg_num);
 
 static axis2_bool_t
 fill_soap_envelope(
@@ -610,7 +611,8 @@
 sandesha2_client_terminate_seq_with_svc_client(
     const axutil_env_t *env,
     axis2_svc_client_t *svc_client,
-    axis2_callback_t *callback)
+    axis2_callback_t *callback,
+    long last_msg_num)
 {
     axis2_svc_ctx_t *svc_ctx = NULL;
     axis2_options_t *options = NULL;
@@ -673,7 +675,7 @@
     }
 
     terminate_envelope = sandesha2_client_configure_terminate_seq(env, options, conf_ctx,

-            seq_prop_mgr);
+            seq_prop_mgr, last_msg_num);
 
     if (!terminate_envelope)
     {
@@ -768,7 +770,8 @@
 sandesha2_client_terminate_seq_with_svc_client_and_seq_key(
     const axutil_env_t *env,
     axis2_svc_client_t *svc_client,
-    axis2_char_t *seq_key)
+    axis2_char_t *seq_key,
+    long last_msg_num)
 {
     axis2_options_t *options = NULL;
     axutil_property_t *property = NULL;
@@ -786,7 +789,7 @@
 
     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);
+    sandesha2_client_terminate_seq_with_svc_client(env, svc_client, NULL, last_msg_num);
     axis2_options_set_property(options, env, SANDESHA2_CLIENT_SEQ_KEY, old_property);
     return AXIS2_SUCCESS;
 }
@@ -1728,7 +1731,8 @@
     const axutil_env_t *env,
     axis2_options_t *options, 
     axis2_conf_ctx_t *conf_ctx,
-    sandesha2_seq_property_mgr_t *seq_prop_mgr)
+    sandesha2_seq_property_mgr_t *seq_prop_mgr,
+    long last_msg_num)
 {
     axis2_endpoint_ref_t *to_epr = NULL;
     axis2_char_t *to = NULL;
@@ -1789,6 +1793,7 @@
         sandesha2_terminate_seq_t *terminate_seq = NULL;
         sandesha2_identifier_t *identifier = NULL;
         sandesha2_seq_property_bean_t *seq_id_bean = NULL;
+        sandesha2_last_msg_number_t *last_msg_number = NULL;
         axis2_char_t *seq_id = NULL;
 
         conf = axis2_conf_ctx_get_conf(conf_ctx, env);
@@ -1839,18 +1844,27 @@
 
         rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, rm_spec_version);
         terminate_seq = sandesha2_terminate_seq_create(env, rm_ns_value);
+        if(!terminate_seq)
+        {
+            return NULL;
+        }
+
         identifier = sandesha2_identifier_create(env, rm_ns_value);
         if(identifier)
         {
             sandesha2_identifier_set_identifier(identifier, env, seq_id);
+            sandesha2_terminate_seq_set_identifier(terminate_seq, env, identifier);
         }
 
-        if(terminate_seq)
+        last_msg_number = sandesha2_last_msg_number_create(env, rm_ns_value);
+        if(last_msg_number)
         {
-            sandesha2_terminate_seq_set_identifier(terminate_seq, env, identifier);
-            sandesha2_terminate_seq_to_soap_envelope(terminate_seq, env, dummy_envelope);
+            sandesha2_last_msg_number_set_last_msg_number(last_msg_number, env, last_msg_num);
+            sandesha2_terminate_seq_set_last_msg_number(terminate_seq, env, last_msg_number);
         }
 
+        sandesha2_terminate_seq_to_soap_envelope(terminate_seq, env, dummy_envelope);
+
         return dummy_envelope;
     }
 

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?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c Sat Aug 30 07:09:52 2008
@@ -249,6 +249,7 @@
     if(seq_ack)
     {
         sandesha2_msg_processor_t *ack_proc = NULL;
+
         ack_proc = sandesha2_ack_msg_processor_create(env);
         sandesha2_msg_processor_process_in_msg(ack_proc, env, rm_msg_ctx);
         sandesha2_msg_processor_free(ack_proc, env);

Modified: webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am Sat Aug 30 07:09:52 2008
@@ -6,6 +6,7 @@
                                         ack_msg_processor.c\
                                         ack_req_msg_processor.c\
                                         close_seq_msg_processor.c\
+                                        close_seq_res_msg_processor.c \
                                         create_seq_res_msg_processor.c\
                                         terminate_seq_msg_processor.c\
                                         terminate_seq_res_msg_processor.c \

Added: webservices/sandesha/trunk/c/src/msgprocessors/close_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/close_seq_res_msg_processor.c?rev=690507&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/close_seq_res_msg_processor.c (added)
+++ webservices/sandesha/trunk/c/src/msgprocessors/close_seq_res_msg_processor.c Sat Aug 30
07:09:52 2008
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <sandesha2_close_seq_res_msg_processor.h>
+#include <sandesha2_seq_ack.h>
+#include <sandesha2_close_seq_res.h>
+#include <sandesha2_storage_mgr.h>
+#include <sandesha2_seq_property_mgr.h>
+#include <sandesha2_create_seq_mgr.h>
+#include <sandesha2_sender_mgr.h>
+#include <sandesha2_permanent_seq_property_mgr.h>
+#include <sandesha2_permanent_create_seq_mgr.h>
+#include <sandesha2_permanent_sender_mgr.h>
+#include <sandesha2_constants.h>
+#include <axis2_conf_ctx.h>
+#include <sandesha2_utils.h>
+
+/** 
+ * @brief Close Sequence Response Message Processor struct impl
+ *	Sandesha2 Close Sequence Response Msg Processor
+ */
+typedef struct sandesha2_close_seq_res_msg_processor_impl 
+                        sandesha2_close_seq_res_msg_processor_impl_t;  
+  
+struct sandesha2_close_seq_res_msg_processor_impl
+{
+	sandesha2_msg_processor_t msg_processor;
+};
+
+#define SANDESHA2_INTF_TO_IMPL(msg_proc) \
+						((sandesha2_close_seq_res_msg_processor_impl_t *)\
+                        (msg_proc))
+
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_process_in_msg (
+    sandesha2_msg_processor_t *msg_processor,
+    const axutil_env_t *env,
+    sandesha2_msg_ctx_t *rm_msg_ctx);
+    
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_process_out_msg(
+    sandesha2_msg_processor_t *msg_processor,
+    const axutil_env_t *env, 
+    sandesha2_msg_ctx_t *rm_msg_ctx);
+    
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_free (
+    sandesha2_msg_processor_t *msg_processor, 
+	const axutil_env_t *env);								
+
+AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
+sandesha2_close_seq_res_msg_processor_create(
+    const axutil_env_t *env)
+{
+    sandesha2_close_seq_res_msg_processor_impl_t *msg_proc_impl = NULL;
+              
+    msg_proc_impl =  ( sandesha2_close_seq_res_msg_processor_impl_t *)AXIS2_MALLOC 
+                        (env->allocator, 
+                        sizeof( sandesha2_close_seq_res_msg_processor_impl_t));
+	
+    if(!msg_proc_impl)
+	{
+		AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+    
+    msg_proc_impl->msg_processor.ops = AXIS2_MALLOC(env->allocator,
+        sizeof(sandesha2_msg_processor_ops_t));
+    if(!msg_proc_impl->msg_processor.ops)
+	{
+        sandesha2_close_seq_res_msg_processor_free((sandesha2_msg_processor_t*)
+                         msg_proc_impl, env);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+    
+    msg_proc_impl->msg_processor.ops->process_in_msg = 
+                        sandesha2_close_seq_res_msg_processor_process_in_msg;
+    msg_proc_impl->msg_processor.ops->process_out_msg = 
+    					sandesha2_close_seq_res_msg_processor_process_out_msg;
+    msg_proc_impl->msg_processor.ops->free = 
+                        sandesha2_close_seq_res_msg_processor_free;
+                        
+	return &(msg_proc_impl->msg_processor);
+}
+
+
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_free (
+    sandesha2_msg_processor_t *msg_processor, 
+	const axutil_env_t *env)
+{
+    sandesha2_close_seq_res_msg_processor_impl_t *msg_proc_impl = NULL;
+	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    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;
+}
+
+
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_process_in_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;
+    sandesha2_close_seq_res_t *term_seq_res = NULL;
+    axis2_char_t *seq_id = 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 *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_res_msg_processor_process_in_msg");
+
+    msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
+    term_seq_res = sandesha2_msg_ctx_get_close_seq_res(rm_msg_ctx, env);
+    if(!term_seq_res)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] Close Sequence part is not available");
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+
+    seq_id = sandesha2_identifier_get_identifier(
+        sandesha2_close_seq_res_get_identifier(term_seq_res, env), env);
+    if(!seq_id || 0 == axutil_strlen(seq_id))
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Invalid sequence id");
+        return AXIS2_FAILURE;
+    }
+
+    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);
+
+    sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
+
+    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_res_msg_processor_process_in_msg");
+
+    return AXIS2_SUCCESS;
+}
+
+    
+static axis2_status_t AXIS2_CALL 
+sandesha2_close_seq_res_msg_processor_process_out_msg(
+    sandesha2_msg_processor_t *msg_processor,
+    const axutil_env_t *env, 
+    sandesha2_msg_ctx_t *rm_msg_ctx)
+{
+    AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+    
+    return AXIS2_SUCCESS;
+}
+

Modified: webservices/sandesha/trunk/c/src/msgprocessors/msg_processor_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/msg_processor_creator.c?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/msg_processor_creator.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/msg_processor_creator.c Sat Aug 30 07:09:52
2008
@@ -35,6 +35,7 @@
 #include <sandesha2_terminate_seq_res_msg_processor.h>
 #include <sandesha2_ack_msg_processor.h>
 #include <sandesha2_close_seq_msg_processor.h>
+#include <sandesha2_close_seq_res_msg_processor.h>
 #include <sandesha2_ack_req_msg_processor.h>
 #include <sandesha2_app_msg_processor.h>
 #include <sandesha2_make_connection_msg_processor.h>
@@ -52,6 +53,7 @@
     int msg_type = -1;
 
     msg_type = sandesha2_msg_ctx_get_msg_type(rm_msg_ctx, env);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "msg_type:%d", msg_type);
     switch(msg_type)
     {
         case SANDESHA2_MSG_TYPE_CREATE_SEQ:
@@ -72,6 +74,9 @@
         case SANDESHA2_MSG_TYPE_CLOSE_SEQ:
             return (sandesha2_msg_processor_t *) 
                 sandesha2_close_seq_msg_processor_create(env);
+        case SANDESHA2_MSG_TYPE_CLOSE_SEQ_RESPONSE:
+            return (sandesha2_msg_processor_t *) sandesha2_close_seq_res_msg_processor_create(env);
+
         case SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG:
             return (sandesha2_msg_processor_t *) 
                 sandesha2_make_connection_msg_processor_create(env);

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=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Sat Aug 30 07:09:52 2008
@@ -176,24 +176,16 @@
         rm_ns = sandesha2_seq_get_namespace_value(
                  seq, env);
     }
-    seq_ack = sandesha2_rm_elements_get_seq_ack(rm_elements, env);
-    if(seq_ack)
-    {
-        sandesha2_msg_ctx_set_seq_ack(rm_msg_ctx, env, seq_ack);
-        rm_ns = sandesha2_seq_ack_get_namespace_value(
-                 seq_ack, env);
-        /*add_op_if_null(env, msg_ctx);*/
-    }
+
     terminate_seq = sandesha2_rm_elements_get_terminate_seq(rm_elements, env);
     if(terminate_seq)
     {
         sandesha2_msg_ctx_set_terminate_seq(rm_msg_ctx, env, terminate_seq);
-        rm_ns = sandesha2_terminate_seq_get_namespace_value(
-                 terminate_seq, env);
+        rm_ns = sandesha2_terminate_seq_get_namespace_value(terminate_seq, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
-    terminate_seq_res = sandesha2_rm_elements_get_terminate_seq_res(rm_elements, 
-        env);
+
+    terminate_seq_res = sandesha2_rm_elements_get_terminate_seq_res(rm_elements, env);
     if(terminate_seq_res)
     {
         sandesha2_msg_ctx_set_terminate_seq_res(rm_msg_ctx, env, 
@@ -202,6 +194,7 @@
                  terminate_seq_res, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
+
     ack_request = sandesha2_rm_elements_get_ack_requested(rm_elements, env);
     if(ack_request)
     {
@@ -235,6 +228,15 @@
         /*add_op_if_null(env, msg_ctx);*/
     }
 
+    seq_ack = sandesha2_rm_elements_get_seq_ack(rm_elements, env);
+    if(seq_ack)
+    {
+        sandesha2_msg_ctx_set_seq_ack(rm_msg_ctx, env, seq_ack);
+        rm_ns = sandesha2_seq_ack_get_namespace_value(
+                 seq_ack, env);
+        /*add_op_if_null(env, msg_ctx);*/
+    }
+
     msg_pending = sandesha2_rm_elements_get_msg_pending(rm_elements, env);
     if(msg_pending)
     {
@@ -282,8 +284,8 @@
     int temp_flow = -1;
     axis2_char_t *dbname = NULL;
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
-        "[sandesha2]Entry:validate_msg");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Entry:validate_msg");
+
     temp_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
     conf_ctx = axis2_msg_ctx_get_conf_ctx(temp_msg_ctx, env);
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
@@ -336,14 +338,6 @@
         idf = sandesha2_seq_get_identifier(seq, env);
         seq_id = sandesha2_identifier_get_identifier(idf, env);
     }
-    else if(seq_ack)
-    {
-        sandesha2_identifier_t *idf = NULL;
-        sandesha2_msg_ctx_set_msg_type(rm_msg_ctx, env, 
-                SANDESHA2_MSG_TYPE_ACK);
-        idf = sandesha2_seq_ack_get_identifier(seq_ack, env);
-        seq_id = sandesha2_identifier_get_identifier(idf, env);
-    }
     else if(ack_request)
     {
         sandesha2_identifier_t *idf = NULL;
@@ -396,6 +390,14 @@
             return AXIS2_FALSE;
         } 
     }
+    else if(seq_ack)
+    {
+        sandesha2_identifier_t *idf = NULL;
+        sandesha2_msg_ctx_set_msg_type(rm_msg_ctx, env, 
+                SANDESHA2_MSG_TYPE_ACK);
+        idf = sandesha2_seq_ack_get_identifier(seq_ack, env);
+        seq_id = sandesha2_identifier_get_identifier(idf, env);
+    }
     else
     {
         sandesha2_msg_ctx_set_msg_type(rm_msg_ctx, env, SANDESHA2_MSG_TYPE_UNKNOWN);

Modified: webservices/sandesha/trunk/c/src/wsrm/close_seq.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/close_seq.c?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/close_seq.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/close_seq.c Sat Aug 30 07:09:52 2008
@@ -279,7 +279,7 @@
 {
     if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
     {
-        return AXIS2_TRUE;
+        return AXIS2_FALSE;
     }
 
     if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))

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=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/close_seq_res.c Sat Aug 30 07:09:52 2008
@@ -114,6 +114,7 @@
     csr_part = axiom_node_get_data_element(csr_node, env);
     if(!csr_part)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Create sequence response
element is empty");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
@@ -121,12 +122,16 @@
     close_seq_res->identifier = sandesha2_identifier_create(env, close_seq_res->ns_val);
     if(!close_seq_res->identifier)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] Identifier element is not present in close sequence response
element");
         return NULL;
     }
 
     if(!sandesha2_identifier_from_om_node(close_seq_res->identifier, env, 
         csr_node))
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "[sandesha2] Parsing close sequence response element into a struct failed");
         return NULL;
     }
 
@@ -237,7 +242,7 @@
 {
     if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2005_02_NS_URI))
     {
-        return AXIS2_TRUE;
+        return AXIS2_FALSE;
     }
 
     if(!axutil_strcmp(namespace, SANDESHA2_SPEC_2007_02_NS_URI))

Modified: webservices/sandesha/trunk/c/src/wsrm/terminate_seq.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/terminate_seq.c?rev=690507&r1=690506&r2=690507&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/terminate_seq.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/terminate_seq.c Sat Aug 30 07:09:52 2008
@@ -26,6 +26,7 @@
 struct sandesha2_terminate_seq_t
 {
 	sandesha2_identifier_t *identifier;
+	sandesha2_last_msg_number_t *last_msg_number;
 	axis2_char_t *ns_val;
 };
 
@@ -56,6 +57,7 @@
 	}
     terminate_seq->ns_val = NULL;
     terminate_seq->identifier = NULL;
+    terminate_seq->last_msg_number = NULL;
     
     terminate_seq->ns_val = (axis2_char_t *)axutil_strdup(env, ns_val);
     
@@ -88,6 +90,13 @@
         sandesha2_identifier_free(terminate_seq->identifier, env);
         terminate_seq->identifier = NULL;
     }
+    
+    if(terminate_seq->last_msg_number)
+    {
+        sandesha2_last_msg_number_free(terminate_seq->last_msg_number, env);
+        terminate_seq->last_msg_number = NULL;
+    }
+
 	AXIS2_FREE(env->allocator, terminate_seq);
 	return AXIS2_SUCCESS;
 }
@@ -114,19 +123,26 @@
     ts_part = axiom_node_get_data_element(ts_node, env);
     if(!ts_part)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
-            AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
 
-    terminate_seq->identifier = sandesha2_identifier_create(env, 
-        terminate_seq->ns_val);
+    terminate_seq->identifier = sandesha2_identifier_create(env, terminate_seq->ns_val);
     if(!terminate_seq->identifier)
     {
         return NULL;
     }
-    sandesha2_identifier_from_om_node(terminate_seq->identifier, env, 
-        ts_node);
+    
+    sandesha2_identifier_from_om_node(terminate_seq->identifier, env, ts_node);
+
+    terminate_seq->last_msg_number = sandesha2_last_msg_number_create(env, terminate_seq->ns_val);
+    if(!terminate_seq->last_msg_number)
+    {
+        return NULL;
+    }
+
+    sandesha2_last_msg_number_from_om_node(terminate_seq->last_msg_number, env, ts_node);
+
     return terminate_seq;
 }
 
@@ -164,6 +180,12 @@
     }
 
     sandesha2_identifier_to_om_node(terminate_seq->identifier, env, ts_node);
+    
+    if(terminate_seq->last_msg_number)
+    {
+        sandesha2_last_msg_number_to_om_node(terminate_seq->last_msg_number, env, ts_node);
+    }
+
     return (axiom_node_t*)om_node;
 }
 
@@ -191,6 +213,31 @@
  	return AXIS2_SUCCESS;
 }
 
+sandesha2_last_msg_number_t * AXIS2_CALL
+sandesha2_terminate_seq_get_last_msg_number(
+    sandesha2_terminate_seq_t *terminate_seq,
+    const axutil_env_t *env)
+{
+	return terminate_seq->last_msg_number;
+}                    	
+
+axis2_status_t AXIS2_CALL                 
+sandesha2_terminate_seq_set_last_msg_number(
+    sandesha2_terminate_seq_t *terminate_seq,
+    const axutil_env_t *env, 
+    sandesha2_last_msg_number_t *last_msg_number)
+{
+ 	if(terminate_seq->last_msg_number)
+	{
+		sandesha2_last_msg_number_free(terminate_seq->last_msg_number, env); 
+		terminate_seq->last_msg_number = NULL; 
+	}
+
+	terminate_seq->last_msg_number = last_msg_number;
+
+ 	return AXIS2_SUCCESS;
+}
+
 axis2_status_t AXIS2_CALL
 sandesha2_terminate_seq_to_soap_envelope(
     sandesha2_terminate_seq_t *terminate_seq,



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


Mime
View raw message