You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sh...@apache.org on 2008/07/07 08:06:38 UTC

svn commit: r674405 - in /webservices/axis2/trunk/c: include/axis2_const.h include/axis2_msg_info_headers.h src/core/addr/msg_info_headers.c src/core/util/core_utils.c src/modules/mod_addr/addr_in_handler.c

Author: shankar
Date: Sun Jul  6 23:06:38 2008
New Revision: 674405

URL: http://svn.apache.org/viewvc?rev=674405&view=rev
Log:
adding urn:uuid prefix to message id. 

Modified:
    webservices/axis2/trunk/c/include/axis2_const.h
    webservices/axis2/trunk/c/include/axis2_msg_info_headers.h
    webservices/axis2/trunk/c/src/core/addr/msg_info_headers.c
    webservices/axis2/trunk/c/src/core/util/core_utils.c
    webservices/axis2/trunk/c/src/modules/mod_addr/addr_in_handler.c

Modified: webservices/axis2/trunk/c/include/axis2_const.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_const.h?rev=674405&r1=674404&r2=674405&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_const.h (original)
+++ webservices/axis2/trunk/c/include/axis2_const.h Sun Jul  6 23:06:38 2008
@@ -395,6 +395,8 @@
 
 #define AXIS2_SERVICE_DIR "servicesDir"
 #define AXIS2_MODULE_DIR "moduleDir"
+
+#define AXIS2_MESSAGE_ID_PREFIX "urn:uuid:"
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/axis2/trunk/c/include/axis2_msg_info_headers.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_msg_info_headers.h?rev=674405&r1=674404&r2=674405&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_info_headers.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_info_headers.h Sun Jul  6 23:06:38 2008
@@ -365,8 +365,8 @@
         const axutil_env_t * env);
 
     /**
-     * Sets message ID. message ID is an absolute IRI that uniquely 
-     * identifies the message.
+     * Sets message ID. message ID is an absolute URI that uniquely 
+     * identifies the message. Message ID will be prefixed with "urn:uuid:"
      * @param msg_info_headers pointer to message information headers struct
      * @param env pointer to environment struct
      * @param message_id message ID string
@@ -379,6 +379,20 @@
         const axis2_char_t * message_id);
 
     /**
+     * Sets message ID. message ID is an absolute URI that uniquely 
+     * identifies the message. Message ID Given will be used.
+     * @param msg_info_headers pointer to message information headers struct
+     * @param env pointer to environment struct
+     * @param message_id message ID string
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_msg_info_headers_set_in_message_id(
+        struct axis2_msg_info_headers *msg_info_headers,
+        const axutil_env_t * env,
+        const axis2_char_t * message_id);
+
+    /**
      * Gets relates to information. 
      * @param msg_info_headers pointer to message information headers struct
      * @param env pointer to environment struct

Modified: webservices/axis2/trunk/c/src/core/addr/msg_info_headers.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/addr/msg_info_headers.c?rev=674405&r1=674404&r2=674405&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/addr/msg_info_headers.c (original)
+++ webservices/axis2/trunk/c/src/core/addr/msg_info_headers.c Sun Jul  6 23:06:38 2008
@@ -242,7 +242,33 @@
 
     if (message_id)
     {
+        msg_info_headers->message_id = axutil_stracat(env, AXIS2_MESSAGE_ID_PREFIX, message_id);
+        if (!(msg_info_headers->message_id))
+        {
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
+        }
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_msg_info_headers_set_in_message_id(
+    struct axis2_msg_info_headers * msg_info_headers,
+    const axutil_env_t * env,
+    const axis2_char_t * message_id)
+{
+    if (msg_info_headers->message_id)
+    {
+        AXIS2_FREE(env->allocator, msg_info_headers->message_id);
+        msg_info_headers->message_id = NULL;
+    }
+
+    if (message_id)
+    {
         msg_info_headers->message_id = axutil_strdup(env, message_id);
+        
         if (!(msg_info_headers->message_id))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);

Modified: webservices/axis2/trunk/c/src/core/util/core_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/util/core_utils.c?rev=674405&r1=674404&r2=674405&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/util/core_utils.c (original)
+++ webservices/axis2/trunk/c/src/core/util/core_utils.c Sun Jul  6 23:06:38 2008
@@ -128,6 +128,9 @@
     axis2_msg_info_headers_set_from(msg_info_headers, env, to);
 
     msg_id = axis2_msg_info_headers_get_message_id(old_msg_info_headers, env);
+   
+    /* we can create with default Relates to namespace. 
+    Actual namespace based on addressing version will be created in addressing out handler */
     relates_to = axis2_relates_to_create(env, msg_id,
                                          AXIS2_WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE);
     axis2_msg_info_headers_set_relates_to(msg_info_headers, env, relates_to);

Modified: webservices/axis2/trunk/c/src/modules/mod_addr/addr_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/modules/mod_addr/addr_in_handler.c?rev=674405&r1=674404&r2=674405&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/modules/mod_addr/addr_in_handler.c (original)
+++ webservices/axis2/trunk/c/src/modules/mod_addr/addr_in_handler.c Sun Jul  6 23:06:38 2008
@@ -442,7 +442,7 @@
             text =
                 axiom_element_get_text(header_block_ele, env,
                                        header_block_node);
-            axis2_msg_info_headers_set_message_id(msg_info_headers, env, text);
+            axis2_msg_info_headers_set_in_message_id(msg_info_headers, env, text);
             axiom_soap_header_block_set_processed(header_block, env);
             msg_id_found = AXIS2_TRUE;
         }