You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/01/25 04:40:18 UTC

svn commit: r499655 - in /webservices/axis2/trunk/c: include/ modules/core/clientapi/ modules/core/context/ modules/core/engine/ modules/core/transport/http/ modules/core/transport/http/sender/ modules/core/transport/http/server/apache2/ modules/mod_ad...

Author: samisa
Date: Wed Jan 24 19:40:17 2007
New Revision: 499655

URL: http://svn.apache.org/viewvc?view=rev&rev=499655
Log:
Fixed more string duplication stuff

Modified:
    webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
    webservices/axis2/trunk/c/include/axis2_mep_client.h
    webservices/axis2/trunk/c/include/axis2_msg_ctx.h
    webservices/axis2/trunk/c/include/axis2_options.h
    webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
    webservices/axis2/trunk/c/modules/core/clientapi/options.c
    webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
    webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
    webservices/axis2/trunk/c/modules/core/engine/addr_disp.c
    webservices/axis2/trunk/c/modules/core/engine/ctx_handler.c
    webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
    webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
    webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
    webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c
    webservices/axis2/trunk/c/util/include/axis2_string.h
    webservices/axis2/trunk/c/util/src/string.c

Modified: webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport_utils.h?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport_utils.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport_utils.h Wed Jan 24 19:40:17 2007
@@ -68,7 +68,7 @@
         axis2_stream_t *out_stream,
         const axis2_char_t *content_type,
         const int content_length,
-        axis2_char_t *soap_action_header,
+        axis2_string_t *soap_action_header,
         const axis2_char_t *request_uri);
 
     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -78,7 +78,7 @@
         axis2_stream_t *in_stream,
         axis2_stream_t *out_stream,
         const axis2_char_t *content_type,
-        axis2_char_t *soap_action_header,
+        axis2_string_t *soap_action_header,
         const axis2_char_t *request_uri,
         axis2_conf_ctx_t *conf_ctx,
         axis2_hash_t *request_params);

Modified: webservices/axis2/trunk/c/include/axis2_mep_client.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_mep_client.h?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_mep_client.h (original)
+++ webservices/axis2/trunk/c/include/axis2_mep_client.h Wed Jan 24 19:40:17 2007
@@ -59,7 +59,7 @@
          * @param env pointer to environment struct
          * @return a pointer to SOAP action string
          */
-        const axis2_char_t *(AXIS2_CALL *
+        axis2_string_t *(AXIS2_CALL *
                 get_soap_action)(
                     const axis2_mep_client_t *mep_client,
                     const axis2_env_t *env);
@@ -160,7 +160,7 @@
                 set_soap_action)(
                     axis2_mep_client_t *mep_client,
                     const axis2_env_t *env,
-                    const axis2_char_t *soap_action);
+                    axis2_string_t *soap_action);
         
         /**
          * Sets WSA action.

Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Wed Jan 24 19:40:17 2007
@@ -938,7 +938,7 @@
      * @param env pointer to environment struct
      * @return SOAP action string
      */
-    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
+    AXIS2_EXTERN axis2_string_t *AXIS2_CALL
     axis2_msg_ctx_get_soap_action(const axis2_msg_ctx_t *msg_ctx,
         const axis2_env_t *env);
 
@@ -952,7 +952,7 @@
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
     axis2_msg_ctx_set_soap_action(axis2_msg_ctx_t *msg_ctx,
         const axis2_env_t *env,
-        const axis2_char_t *soap_action);
+        axis2_string_t *soap_action);
 
     /**
      * Gets the boolean value indicating if MTOM is enabled or not.
@@ -1158,7 +1158,7 @@
      * @param env pointer to environment struct
      * @return service group context ID string
      */
-    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
+    AXIS2_EXTERN const axis2_string_t *AXIS2_CALL
     axis2_msg_ctx_get_svc_grp_ctx_id(const axis2_msg_ctx_t *msg_ctx,
         const axis2_env_t *env);
 
@@ -1172,7 +1172,7 @@
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
     axis2_msg_ctx_set_svc_grp_ctx_id(axis2_msg_ctx_t *msg_ctx,
         const axis2_env_t *env,
-        const axis2_char_t *svc_grp_ctx_id);
+        axis2_string_t *svc_grp_ctx_id);
 
     /**
      * Finds the service to be invoked. This function is used by dispatchers 

Modified: webservices/axis2/trunk/c/include/axis2_options.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_options.h?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_options.h (original)
+++ webservices/axis2/trunk/c/include/axis2_options.h Wed Jan 24 19:40:17 2007
@@ -655,7 +655,7 @@
          * @param env pointer to environment struct
          * @return SOAP Action string if set, else NULL
          */
-        const axis2_char_t* (AXIS2_CALL *
+        axis2_string_t* (AXIS2_CALL *
                 get_soap_action)(
                     const axis2_options_t *options,
                     const axis2_env_t *env);
@@ -671,7 +671,7 @@
                 set_soap_action)(
                     axis2_options_t *options,
                     const axis2_env_t *env,
-                    const axis2_char_t *soap_action);
+                    axis2_string_t *soap_action);
 
 		/**
 		 * Sets xml parser reset

Modified: webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c Wed Jan 24 19:40:17 2007
@@ -36,7 +36,7 @@
     /** SOAP version URI */
     axis2_char_t *soap_version_uri;
     /** SOAP action */
-    axis2_char_t *soap_action;
+    axis2_string_t *soap_action;
     /** WSA action  */
     axis2_char_t *wsa_action;
 }
@@ -45,7 +45,7 @@
 /** Interface to implementation conversion macro */
 #define AXIS2_INTF_TO_IMPL(mep_client) ((axis2_mep_client_impl_t *)mep_client)
 
-const axis2_char_t *AXIS2_CALL
+axis2_string_t *AXIS2_CALL
 axis2_mep_client_get_soap_action(
     const axis2_mep_client_t *mep_client,
     const axis2_env_t *env);
@@ -90,7 +90,7 @@
 axis2_mep_client_set_soap_action(
     axis2_mep_client_t *mep_client,
     const axis2_env_t *env,
-    const axis2_char_t *soap_action);
+    axis2_string_t *soap_action);
 
 axis2_status_t AXIS2_CALL
 axis2_mep_client_set_wsa_action(
@@ -185,7 +185,7 @@
     return &(mep_client_impl->mep_client);
 }
 
-const axis2_char_t *AXIS2_CALL
+axis2_string_t *AXIS2_CALL
 axis2_mep_client_get_soap_action(
     const axis2_mep_client_t *mep_client,
     const axis2_env_t *env)
@@ -461,7 +461,7 @@
 axis2_mep_client_set_soap_action(
     axis2_mep_client_t *mep_client,
     const axis2_env_t *env,
-    const axis2_char_t *soap_action)
+    axis2_string_t *soap_action)
 {
     axis2_mep_client_impl_t *mep_client_impl = NULL;
 
@@ -471,13 +471,13 @@
 
     if (mep_client_impl->soap_action)
     {
-        AXIS2_FREE(env->allocator, mep_client_impl->soap_action);
+        axis2_string_free(mep_client_impl->soap_action, env);
         mep_client_impl->soap_action = NULL;
     }
 
     if (soap_action)
     {
-        mep_client_impl->soap_action = AXIS2_STRDUP(soap_action, env);
+        mep_client_impl->soap_action = axis2_string_clone(soap_action, env);
         if (!(mep_client_impl->soap_action))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -591,7 +591,7 @@
 
     if (mep_client_impl->soap_action)
     {
-        AXIS2_FREE(env->allocator, mep_client_impl->soap_action);
+        axis2_string_free(mep_client_impl->soap_action, env);
         mep_client_impl->soap_action = NULL;
     }
 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/options.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/options.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/options.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/options.c Wed Jan 24 19:40:17 2007
@@ -56,7 +56,7 @@
 
     axis2_bool_t manage_session;
     axis2_bool_t enable_mtom;
-    axis2_char_t *soap_action;
+    axis2_string_t *soap_action;
 	axis2_bool_t xml_parser_reset;
 }
 axis2_options_impl_t;
@@ -347,9 +347,9 @@
 axis2_options_set_soap_action(
     axis2_options_t *options,
     const axis2_env_t *env,
-    const axis2_char_t *soap_action);
+    axis2_string_t *soap_action);
 
-const axis2_char_t* AXIS2_CALL
+axis2_string_t* AXIS2_CALL
 axis2_options_get_soap_action(
     const axis2_options_t *options,
     const axis2_env_t *env);
@@ -1224,7 +1224,7 @@
 
     if (options_impl->soap_action)
     {
-        AXIS2_FREE(env->allocator, options_impl->soap_action);
+        axis2_string_free(options_impl->soap_action, env);
         options_impl->soap_action = NULL;
     }
 
@@ -1382,7 +1382,7 @@
     return AXIS2_INTF_TO_IMPL(options)->enable_mtom;
 }
 
-const axis2_char_t* AXIS2_CALL
+axis2_string_t* AXIS2_CALL
 axis2_options_get_soap_action(
     const axis2_options_t *options,
     const axis2_env_t *env)
@@ -1399,7 +1399,7 @@
 axis2_options_set_soap_action(
     axis2_options_t *options,
     const axis2_env_t *env,
-    const axis2_char_t *soap_action)
+    axis2_string_t *soap_action)
 {
     axis2_options_impl_t *options_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -1408,13 +1408,13 @@
 
     if (options_impl->soap_action)
     {
-        AXIS2_FREE(env->allocator, options_impl->soap_action);
+        axis2_string_free(options_impl->soap_action, env);
         options_impl->soap_action = NULL;
     }
 
     if (soap_action)
     {
-        options_impl->soap_action = axis2_strdup(soap_action, env);
+        options_impl->soap_action = axis2_string_clone(soap_action, env);
     }
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/conf_ctx.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/conf_ctx.c Wed Jan 24 19:40:17 2007
@@ -471,7 +471,7 @@
     const axis2_env_t *env,
     axis2_msg_ctx_t *msg_ctx)
 {
-    const axis2_char_t *svc_grp_ctx_id = NULL;
+    axis2_char_t *svc_grp_ctx_id = NULL;
     axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
     axis2_svc_ctx_t *svc_ctx = NULL;
     axis2_svc_t *svc = NULL;
@@ -512,12 +512,13 @@
     svc_grp = AXIS2_SVC_GET_PARENT(svc, env);
     if (svc_grp)
     {
-        svc_grp_ctx_id = AXIS2_SVC_GRP_GET_NAME(svc_grp, env);
+        svc_grp_ctx_id = (axis2_char_t*)AXIS2_SVC_GRP_GET_NAME(svc_grp, env);
     }
 
     if (!svc_grp_ctx_id)
     {
-        svc_grp_ctx_id = AXIS2_MSG_CTX_GET_SVC_GRP_CTX_ID(msg_ctx, env);
+        svc_grp_ctx_id = (axis2_char_t*)axis2_string_get_buffer(
+            AXIS2_MSG_CTX_GET_SVC_GRP_CTX_ID(msg_ctx, env), env);
     }
 
     /* by this time service group context id must have a value,
@@ -542,7 +543,13 @@
     if (!svc_grp_ctx_id)
     {
         svc_grp_ctx_id = axis2_uuid_gen(env);
-        AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id);
+        if (svc_grp_ctx_id)
+        {
+            axis2_string_t *svc_grp_ctx_id_str = 
+                axis2_string_create_assume_ownership(env, &svc_grp_ctx_id);
+            AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id_str);
+            axis2_string_free(svc_grp_ctx_id_str, env);
+        }
     }
 
     if (!svc_grp_ctx)

Modified: webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/msg_ctx.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Wed Jan 24 19:40:17 2007
@@ -85,7 +85,7 @@
     /** paused handler name */
     axis2_string_t *paused_handler_name;
     /** SOAP action */
-    axis2_char_t *soap_action;
+    axis2_string_t *soap_action;
     /** are we doing MTOM now? */
     axis2_bool_t doing_mtom;
     /** are we doing REST now? */
@@ -95,7 +95,7 @@
     /** use SOAP 1.1? */
     axis2_bool_t is_soap_11;
     /** service group context id */
-    axis2_char_t *svc_grp_ctx_id;
+    axis2_string_t *svc_grp_ctx_id;
     /** qname of transport in */
     AXIS2_TRANSPORT_ENUMS transport_in_desc_enum;
     /** qname of transport out */
@@ -319,13 +319,13 @@
 
     if (msg_ctx->soap_action)
     {
-        AXIS2_FREE(env->allocator, msg_ctx->soap_action);
+        axis2_string_free(msg_ctx->soap_action, env);
         msg_ctx->soap_action = NULL;
     }
 
     if (msg_ctx->svc_grp_ctx_id)
     {
-        AXIS2_FREE(env->allocator, msg_ctx->svc_grp_ctx_id);
+        axis2_string_free(msg_ctx->svc_grp_ctx_id, env);
         msg_ctx->svc_grp_ctx_id = NULL;
     }
 
@@ -1419,7 +1419,7 @@
     return AXIS2_SUCCESS;
 }
 
-const axis2_char_t *AXIS2_CALL
+axis2_string_t *AXIS2_CALL
 axis2_msg_ctx_get_soap_action(
     const axis2_msg_ctx_t *msg_ctx,
     const axis2_env_t *env)
@@ -1433,19 +1433,19 @@
 axis2_msg_ctx_set_soap_action(
     struct axis2_msg_ctx *msg_ctx,
     const axis2_env_t *env,
-    const axis2_char_t *soap_action)
+    axis2_string_t *soap_action)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     if (msg_ctx->soap_action)
     {
-        AXIS2_FREE(env->allocator, msg_ctx->soap_action);
+        axis2_string_free(msg_ctx->soap_action, env);
         msg_ctx->soap_action = NULL;
     }
 
     if (soap_action)
     {
-        msg_ctx->soap_action = AXIS2_STRDUP(soap_action, env);
+        msg_ctx->soap_action = axis2_string_clone(soap_action, env);
         if (!(msg_ctx->soap_action))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -1655,7 +1655,7 @@
     return AXIS2_SUCCESS;
 }
 
-const axis2_char_t *AXIS2_CALL
+const axis2_string_t *AXIS2_CALL
 axis2_msg_ctx_get_svc_grp_ctx_id(
     const axis2_msg_ctx_t *msg_ctx,
     const axis2_env_t *env)
@@ -1668,24 +1668,19 @@
 axis2_msg_ctx_set_svc_grp_ctx_id(
     struct axis2_msg_ctx *msg_ctx,
     const axis2_env_t *env,
-    const axis2_char_t *svc_grp_ctx_id)
+    axis2_string_t *svc_grp_ctx_id)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     if (msg_ctx->svc_grp_ctx_id)
     {
-        AXIS2_FREE(env->allocator, msg_ctx->svc_grp_ctx_id);
+        axis2_string_free(msg_ctx->svc_grp_ctx_id, env);
         msg_ctx->svc_grp_ctx_id = NULL;
     }
 
     if (svc_grp_ctx_id)
     {
-        msg_ctx->svc_grp_ctx_id = AXIS2_STRDUP(svc_grp_ctx_id, env);
-        if (!(msg_ctx->svc_grp_ctx_id))
-        {
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            return AXIS2_FAILURE;
-        }
+        msg_ctx->svc_grp_ctx_id = axis2_string_clone(svc_grp_ctx_id, env);
     }
     return AXIS2_SUCCESS;
 }
@@ -1747,7 +1742,7 @@
 {
     axis2_property_t *rest_val = NULL;
 	axis2_char_t *value;
-	const axis2_char_t *soap_action = NULL;;
+	axis2_string_t *soap_action = NULL;;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, options, AXIS2_FAILURE);
@@ -1780,14 +1775,14 @@
 
     if (msg_ctx->soap_action)
     {
-        AXIS2_FREE(env->allocator, msg_ctx->soap_action);
+        axis2_string_free(msg_ctx->soap_action, env);
         msg_ctx->soap_action = NULL;
     }
     
     soap_action = AXIS2_OPTIONS_GET_SOAP_ACTION(options, env);
-    if (AXIS2_OPTIONS_GET_SOAP_ACTION(options, env))
+    if (soap_action)
     {
-        msg_ctx->soap_action = AXIS2_STRDUP(soap_action, env);
+        msg_ctx->soap_action = axis2_string_clone(soap_action, env);
     }
 
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/core/engine/addr_disp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/engine/addr_disp.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/addr_disp.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/addr_disp.c Wed Jan 24 19:40:17 2007
@@ -238,8 +238,10 @@
                             svc_grp_ctx = AXIS2_SVC_CTX_GET_PARENT(svc_ctx, env);
                             if (svc_grp_ctx)
                             {
-                                AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env,
-                                        AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+                                axis2_string_t *svc_grp_ctx_id_str = 
+                                    axis2_string_create(env, AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+                                AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id_str);
+                                axis2_string_free(svc_grp_ctx_id_str, env);
                             }
                             return AXIS2_SUCCESS;
                         }

Modified: webservices/axis2/trunk/c/modules/core/engine/ctx_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/engine/ctx_handler.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/ctx_handler.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/ctx_handler.c Wed Jan 24 19:40:17 2007
@@ -113,8 +113,10 @@
         svc_grp_ctx = AXIS2_SVC_CTX_GET_PARENT(svc_ctx, env);
         if (svc_grp_ctx)
         {
-            AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env,
-                    AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+            axis2_string_t *svc_grp_ctx_id_str = 
+                axis2_string_create(env, AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+            AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id_str);
+            axis2_string_free(svc_grp_ctx_id_str, env);
         }
         return AXIS2_SUCCESS;
     }
@@ -129,12 +131,15 @@
         svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
         if (svc_ctx)
         {
+            axis2_string_t *svc_grp_ctx_id_str = NULL;
+
             svc_grp_ctx = AXIS2_SVC_CTX_GET_PARENT(svc_ctx, env);
             AXIS2_MSG_CTX_SET_SVC_CTX(msg_ctx, env, svc_ctx);
             AXIS2_MSG_CTX_SET_SVC_GRP_CTX(msg_ctx, env, svc_grp_ctx);
 
-            AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env,
-                    AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+            svc_grp_ctx_id_str = axis2_string_create(env, AXIS2_SVC_GRP_CTX_GET_ID(svc_grp_ctx, env));
+            AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id_str);
+            axis2_string_free(svc_grp_ctx_id_str, env);
         }
         return AXIS2_SUCCESS;
     }

Modified: webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c Wed Jan 24 19:40:17 2007
@@ -101,7 +101,7 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, svc, NULL);
 
-    action = AXIS2_MSG_CTX_GET_SOAP_ACTION(msg_ctx, env);
+    action = axis2_string_get_buffer(AXIS2_MSG_CTX_GET_SOAP_ACTION(msg_ctx, env), env);
 
     if (action)
     {

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c Wed Jan 24 19:40:17 2007
@@ -55,7 +55,7 @@
     axis2_stream_t *out_stream,
     const axis2_char_t *content_type,
     const int content_length,
-    axis2_char_t *soap_action_header,
+    axis2_string_t *soap_action_header,
     const axis2_char_t *request_uri);
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -65,7 +65,7 @@
     axis2_stream_t *in_stream,
     axis2_stream_t *out_stream,
     const axis2_char_t *content_type,
-    axis2_char_t *soap_action_header,
+    axis2_string_t *soap_action_header,
     const axis2_char_t *request_uri,
     axis2_conf_ctx_t *conf_ctx,
     axis2_hash_t *request_params);
@@ -159,7 +159,7 @@
     axis2_stream_t *out_stream,
     const axis2_char_t *content_type,
     const int content_length,
-    axis2_char_t *soap_action_header,
+    axis2_string_t *soap_action_header,
     const axis2_char_t *request_uri)
 {
     axiom_soap_envelope_t *soap_envelope = NULL;
@@ -180,6 +180,8 @@
     axis2_char_t *soap_body_str = NULL;
     axis2_stream_t *stream = NULL;
     axis2_bool_t do_rest = AXIS2_FALSE;
+    axis2_char_t *soap_action = NULL;
+    unsigned int soap_action_len = 0;
 
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FAILURE);
@@ -198,17 +200,20 @@
     callback_ctx->unread_len = content_length;
     callback_ctx->chunked_stream = NULL;
 
-    if (soap_action_header && (strlen(soap_action_header) > 0))
+    soap_action = (axis2_char_t*)axis2_string_get_buffer(soap_action_header, env);
+    soap_action_len = axis2_string_get_length(soap_action_header, env);
+    
+    if (soap_action && (soap_action_len > 0))
     {
         /* remove leading and trailing " s */
-        if ('"' == soap_action_header[0])
+        if ('"' == soap_action[0])
         {
-            memmove(soap_action_header, soap_action_header + sizeof(axis2_char_t),
-                    strlen(soap_action_header) + sizeof(axis2_char_t));
+            memmove(soap_action, soap_action + sizeof(axis2_char_t),
+                    soap_action_len + sizeof(axis2_char_t));
         }
-        if ('"' == soap_action_header[strlen(soap_action_header) -1])
+        if ('"' == soap_action[soap_action_len -1])
         {
-            soap_action_header[strlen(soap_action_header) -1] = '\0';
+            soap_action[soap_action_len -1] = '\0';
         }
     }
     property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS,
@@ -515,7 +520,7 @@
     axis2_stream_t *in_stream,
     axis2_stream_t *out_stream,
     const axis2_char_t *content_type,
-    axis2_char_t *soap_action_header,
+    axis2_string_t *soap_action_header,
     const axis2_char_t *request_uri,
     axis2_conf_ctx_t *conf_ctx,
     axis2_hash_t *request_params)

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c Wed Jan 24 19:40:17 2007
@@ -161,6 +161,7 @@
     axis2_transport_in_desc_t *in_desc = NULL;
     axis2_char_t *http_version = NULL;
     axis2_char_t *soap_action = NULL;
+    axis2_string_t *soap_action_str = NULL;
     axis2_bool_t processed = AXIS2_FALSE;
     axis2_char_t *ctx_written = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -272,11 +273,11 @@
             AXIS2_FALSE);
 
     svc_grp_uuid = axis2_uuid_gen(env);
-    AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_uuid);
     if (svc_grp_uuid)
     {
-        AXIS2_FREE(env->allocator, svc_grp_uuid);
-        svc_grp_uuid = NULL;
+        axis2_string_t *svc_grp_uuid_str = axis2_string_create_assume_ownership(env, &svc_grp_uuid);
+        AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_uuid_str);
+        axis2_string_free(svc_grp_uuid_str, env);
     }
 
     property = axis2_property_create(env);
@@ -295,6 +296,7 @@
                     AXIS2_HTTP_SIMPLE_REQUEST_GET_FIRST_HEADER(
                         simple_request, env, AXIS2_HTTP_HEADER_SOAP_ACTION),
                     env);
+        soap_action_str = axis2_string_create(env, soap_action);
     }
     if (0 == AXIS2_STRCASECMP(AXIS2_HTTP_REQUEST_LINE_GET_METHOD(
                 AXIS2_HTTP_SIMPLE_REQUEST_GET_REQUEST_LINE(
@@ -303,7 +305,7 @@
         processed = axis2_http_transport_utils_process_http_get_request
                 (env, msg_ctx, request_body, out_stream,
                         AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_TYPE(
-                            simple_request, env) , soap_action,
+                            simple_request, env) , soap_action_str,
                         AXIS2_URL_TO_EXTERNAL_FORM(request_url, env),
                         conf_ctx,
                         axis2_http_transport_utils_get_request_params(env,
@@ -343,7 +345,7 @@
         status = axis2_http_transport_utils_process_http_post_request
                 (env, msg_ctx, request_body, out_stream,
                         AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_TYPE(
-                            simple_request, env) , content_length, soap_action,
+                            simple_request, env) , content_length, soap_action_str,
                         url_external_form);
         if (status == AXIS2_FAILURE)
         {
@@ -452,6 +454,7 @@
     
     msg_ctx = NULL;
     AXIS2_URL_FREE(request_url, env);
+    axis2_string_free(soap_action_str, env);
     request_url = NULL;
     return status;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c Wed Jan 24 19:40:17 2007
@@ -579,7 +579,7 @@
 
     url = AXIS2_ENDPOINT_REF_GET_ADDRESS(epr, env);
     
-    soap_action = AXIS2_MSG_CTX_GET_SOAP_ACTION(msg_ctx, env);
+    soap_action = axis2_string_get_buffer(AXIS2_MSG_CTX_GET_SOAP_ACTION(msg_ctx, env), env);
     
     if (NULL == soap_action)
     {

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c Wed Jan 24 19:40:17 2007
@@ -146,7 +146,7 @@
     axis2_transport_out_desc_t *out_desc = NULL;
     axis2_transport_in_desc_t *in_desc = NULL;
     axis2_char_t *http_version = NULL;
-    axis2_char_t *soap_action = NULL;
+    axis2_string_t *soap_action = NULL;
     axis2_bool_t processed = AXIS2_FALSE;
     axis2_char_t *ctx_written = NULL;
     int content_length = -1;
@@ -217,8 +217,12 @@
                    axis2_apache2_worker_get_headers(apache2_worker, env, 
                          simple_request), AXIS2_FALSE);*/
     ctx_uuid = axis2_uuid_gen(env);
-    AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, ctx_uuid);
-    AXIS2_FREE(env->allocator, ctx_uuid);
+    if (ctx_uuid)
+    {
+        axis2_string_t *uuid_str = axis2_string_create_assume_ownership(env, &ctx_uuid);
+        AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, uuid_str);
+        axis2_string_free(uuid_str, env);
+    }
 
     property = axis2_property_create(env);
     AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
@@ -230,8 +234,9 @@
     AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_HTTP_OUT_TRANSPORT_INFO,
             property, AXIS2_FALSE);
 
-    soap_action = (axis2_char_t *)apr_table_get(request->headers_in,
-            AXIS2_HTTP_HEADER_SOAP_ACTION);
+    soap_action = axis2_string_create(env, 
+            (axis2_char_t *)apr_table_get(request->headers_in,
+            AXIS2_HTTP_HEADER_SOAP_ACTION));
     request_body = axis2_stream_create_apache2(env, request);
     if (NULL == request_body)
     {
@@ -347,6 +352,8 @@
     {
         AXIS2_MSG_CTX_FREE(msg_ctx, env);
     }*/
+
+    axis2_string_free(soap_action, env);
 
     msg_ctx = NULL;
     return send_status;

Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c Wed Jan 24 19:40:17 2007
@@ -223,13 +223,15 @@
                 conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
                 if (conf_ctx && grp_id)
                 {
+                    axis2_string_t *svc_grp_ctx_id_str = axis2_string_create(env, grp_id);
                     axis2_svc_grp_ctx_t *svc_ctx_grp_ctx = AXIS2_CONF_CTX_GET_SVC_GRP_CTX(conf_ctx, env, grp_id);
                     if (!svc_ctx_grp_ctx)
                     {
                         /** TODO, set error */
                         return AXIS2_FAILURE;
                     }
-                    AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, grp_id);
+                    AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_ctx_id_str);
+                    axis2_string_free(svc_grp_ctx_id_str, env);
                     return AXIS2_SUCCESS;
                 }
             }

Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c Wed Jan 24 19:40:17 2007
@@ -327,7 +327,8 @@
 
 
         /* add the service group id as a reference parameter */
-        svc_group_context_id = AXIS2_MSG_CTX_GET_SVC_GRP_CTX_ID(msg_ctx, env);
+        svc_group_context_id = axis2_string_get_buffer(
+            AXIS2_MSG_CTX_GET_SVC_GRP_CTX_ID(msg_ctx, env), env);
 
         axis2_addr_out_handler_add_to_soap_header(env, epr,
                 AXIS2_WSA_REPLY_TO,

Modified: webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c (original)
+++ webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c Wed Jan 24 19:40:17 2007
@@ -30,6 +30,7 @@
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axiom_node_t *ret_node = NULL;
+    axis2_string_t *soap_action = NULL;
 
     /* Set up the environment */
     env = axis2_env_create_all("echo_blocking_soap11.log", AXIS2_LOG_LEVEL_TRACE);
@@ -53,7 +54,9 @@
     options = axis2_options_create(env);
     AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
     AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP11);
-    AXIS2_OPTIONS_SET_SOAP_ACTION(options, env, "http://ws.apache.org/axis2/c/samples/echo/soap_action");
+    soap_action = axis2_string_create(env, "http://ws.apache.org/axis2/c/samples/echo/soap_action");
+    AXIS2_OPTIONS_SET_SOAP_ACTION(options, env, soap_action);
+    axis2_string_free(soap_action, env);
 
     /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
      * using the axis2.xml file.

Modified: webservices/axis2/trunk/c/util/include/axis2_string.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_string.h?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_string.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_string.h Wed Jan 24 19:40:17 2007
@@ -46,6 +46,17 @@
     AXIS2_EXTERN axis2_string_t * AXIS2_CALL
     axis2_string_create(const axis2_env_t *env,
         const axis2_char_t *str);
+    
+    /**
+     * Creates a string struct.
+     * @param str pointer to string. string struct would not create a duplicate 
+     * of this, but would assume ownership
+     * @param env pointer to environment struct
+     * @return a pointer to newly created string struct
+     */
+    AXIS2_EXTERN axis2_string_t * AXIS2_CALL
+    axis2_string_create_assume_ownership(const axis2_env_t *env,
+        axis2_char_t **str);
 
     /**
      * Creates a string struct.

Modified: webservices/axis2/trunk/c/util/src/string.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/string.c?view=diff&rev=499655&r1=499654&r2=499655
==============================================================================
--- webservices/axis2/trunk/c/util/src/string.c (original)
+++ webservices/axis2/trunk/c/util/src/string.c Wed Jan 24 19:40:17 2007
@@ -79,6 +79,45 @@
     return string;
 }
 
+AXIS2_EXTERN axis2_string_t * AXIS2_CALL
+axis2_string_create_assume_ownership(const axis2_env_t *env,
+    axis2_char_t **str)
+{
+    axis2_string_t *string = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+
+    /* str can't be null */
+    if (!str || !(*str))
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, 
+            AXIS2_FAILURE);
+        return NULL;
+    }
+
+    string = (axis2_string_t *) AXIS2_MALLOC(env->allocator,
+            sizeof(axis2_string_t));
+    if (!string)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    /* set properties */
+    string->buffer = *str;    
+    string->length = axis2_strlen(*str);
+    string->ref_count = 1;
+    string->owns_buffer = AXIS2_TRUE;    
+    
+    if (string->length < 1)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, 
+            AXIS2_FAILURE);
+        axis2_string_free(string, env);
+        return NULL;
+    }
+    
+    return string;
+}
+
 AXIS2_EXTERN axis2_string_t* AXIS2_CALL
 axis2_string_create_const(const axis2_env_t *env,
     axis2_char_t **str)



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