svn commit: r711544 - in /webservices/sandesha/trunk/c: config/sqlite_schema.sh include/sandesha2_utils.h src/util/sandesha2_utils.c

[email protected]
Newsgroups gmane.comp.apache.webservices.fx.devel
Message-ID <[email protected]>
Author: damitha
Date: Wed Nov  5 01:42:19 2008
New Revision: 711544

URL: http://svn.apache.org/viewvc?rev=711544&view=rev
Log:
Fixing SANDESHA2C-67. Now when creating new related message context I copy all properties from reference message context.

Modified:
    webservices/sandesha/trunk/c/config/sqlite_schema.sh
    webservices/sandesha/trunk/c/include/sandesha2_utils.h
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c

Modified: webservices/sandesha/trunk/c/config/sqlite_schema.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/sqlite_schema.sh?rev=711544&r1=711543&r2=711544&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/config/sqlite_schema.sh (original)
+++ webservices/sandesha/trunk/c/config/sqlite_schema.sh Wed Nov  5 01:42:19 2008
@@ -15,14 +15,5 @@
     msg_ctx_ref_key varchar(100), internal_seq_id varchar(200), sent_count int, 
     msg_no long, send boolean, resend boolean, time_to_send long, msg_type int, 
     seq_id varchar(200), wsrm_anon_uri varchar(100), to_address varchar(100))"
-sqlite3 sandesha2_db "create table next_msg(seq_id varchar(200) primary key, 
-    internal_seq_id varchar(200), ref_msg_key varchar(100), polling_mode boolean, msg_no long)"
 sqlite3 sandesha2_db "create table seq_property(id varchar(200) , 
     seq_id varchar(200), name varchar(200), value varchar(200))"
-sqlite3 sandesha2_db "create table msg(stored_key varchar(200) primary key,
-    msg_id varchar(200), soap_env_str text, soap_version int, transport_out varchar(100),
-    op varchar(100), svc varchar(100), svc_grp varchar(100), op_mep varchar(100), to_url varchar(200),
-    reply_to varchar(200), transport_to varchar(200), execution_chain_str varchar(200), flow int, 
-    msg_recv_str varchar(200), svr_side boolean, in_msg_store_key varchar(200), prop_str varchar(8192), 
-    action varchar(200))"
-sqlite3 sandesha2_db "create table response(seq_id varchar(200), response_str text, msg_no int, soap_version int)"

Modified: webservices/sandesha/trunk/c/include/sandesha2_utils.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_utils.h?rev=711544&r1=711543&r2=711544&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_utils.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_utils.h Wed Nov  5 01:42:19 2008
@@ -316,6 +316,11 @@
     const axutil_env_t *env,
     axis2_msg_ctx_t *msg_ctx);
 
+void AXIS2_CALL
+sandesha2_util_clone_property_map(
+    const axutil_env_t * env,
+    axis2_msg_ctx_t *ref_msg_ctx,
+    axis2_msg_ctx_t *new_msg_ctx);
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?rev=711544&r1=711543&r2=711544&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Wed Nov  5 01:42:19 2008
@@ -586,6 +586,7 @@
         axis2_msg_ctx_set_transport_url(new_msg, env, transport_to);
     }
 
+    sandesha2_util_clone_property_map(env, ref_msg, new_msg);
     property = axis2_msg_ctx_get_property(ref_msg, env, AXIS2_WSA_VERSION);
     if(!property)
     {
@@ -1629,3 +1630,41 @@
         return AXIS2_FALSE;
     }
 }
+
+void AXIS2_CALL
+sandesha2_util_clone_property_map(
+    const axutil_env_t * env,
+    axis2_msg_ctx_t *ref_msg_ctx,
+    axis2_msg_ctx_t *new_msg_ctx)
+{
+    axis2_ctx_t *ctx = NULL;
+    axis2_ctx_t *new_ctx = NULL;
+    axutil_hash_t *property_map = NULL;
+
+    ctx = axis2_msg_ctx_get_base(ref_msg_ctx, env);
+    new_ctx = axis2_msg_ctx_get_base(new_msg_ctx, env);
+    property_map = axis2_ctx_get_property_map(ctx, env);
+    
+    if (ctx)
+    {
+        axutil_hash_index_t *index = NULL;
+
+        for (index = axutil_hash_first(property_map, env); index; index = axutil_hash_next(env, 
+                    index))
+        {
+            axutil_property_t *new_property = NULL;
+            void *v = NULL;
+            const void *k = NULL;
+            axis2_char_t *key = NULL;
+            axutil_property_t *property = NULL;
+
+            axutil_hash_this(index, &k, NULL, &v);
+            key = (axis2_char_t *) k;
+            property = (axutil_property_t *) v;
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] property:%s", key);
+            new_property = sandesha2_util_property_clone(env, property);
+            axis2_msg_ctx_set_property(new_msg_ctx, env, key, new_property);
+        }
+    }
+}
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.