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 2006/12/06 14:40:40 UTC

svn commit: r483075 - in /webservices/axis2/trunk/c: include/axis2_options.h modules/core/clientapi/options.c modules/core/context/msg_ctx.c modules/core/transport/http/sender/http_transport_sender.c samples/user_guide/clients/echo_blocking_soap11.c

Author: samisa
Date: Wed Dec  6 05:40:39 2006
New Revision: 483075

URL: http://svn.apache.org/viewvc?view=rev&rev=483075
Log:
Added support for SOAP action. Fix for AXIS2C-437

Modified:
    webservices/axis2/trunk/c/include/axis2_options.h
    webservices/axis2/trunk/c/modules/core/clientapi/options.c
    webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
    webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c

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=483075&r1=483074&r2=483075
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_options.h (original)
+++ webservices/axis2/trunk/c/include/axis2_options.h Wed Dec  6 05:40:39 2006
@@ -638,6 +638,31 @@
                     const axis2_env_t *env);
 
         /**
+         * Gets SOAP action.
+         * @param options pointer to options struct
+         * @param env pointer to environment struct
+         * @return SOAP Action string if set, else NULL
+         */
+        const axis2_char_t* (AXIS2_CALL *
+                get_soap_action)(
+                    const axis2_options_t *options,
+                    const axis2_env_t *env);
+
+        /**
+         * Sets SOAP action
+         * @param options pointer to options struct
+         * @param env pointer to environment struct
+         * @param action pointer to SOAP action string
+         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
+        axis2_status_t (AXIS2_CALL *
+                set_soap_action)(
+                    axis2_options_t *options,
+                    const axis2_env_t *env,
+                    const axis2_char_t *soap_action);
+
+
+        /**
          * Frees options struct.
          * @param options pointer to options struct
          * @param env pointer to environment struct
@@ -907,6 +932,17 @@
     @sa axis2_options_ops#get_enable_mtom */
 #define AXIS2_OPTIONS_GET_ENABLE_MTOM(options, env) \
       ((options)->ops->get_enable_mtom(options, env))
+
+/** Gets SOAP action.
+    @sa axis2_options_ops#get_soap_action */
+#define AXIS2_OPTIONS_GET_SOAP_ACTION(options, env) \
+      ((options)->ops->get_soap_action(options, env))
+
+/** Sets the SOAP action.
+    @sa axis2_options_ops#set_soap_action */
+#define AXIS2_OPTIONS_SET_SOAP_ACTION(options, env, action) \
+      ((options)->ops->set_soap_action(options, env, action))
+
 
 /** Frees the options struct.
     @sa axis2_options_ops#free*/

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=483075&r1=483074&r2=483075
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/options.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/options.c Wed Dec  6 05:40:39 2006
@@ -55,6 +55,7 @@
 
     axis2_bool_t manage_session;
     axis2_bool_t enable_mtom;
+    axis2_char_t *soap_action;
 }
 axis2_options_impl_t;
 
@@ -334,6 +335,17 @@
     const axis2_options_t *options,
     const axis2_env_t *env);
 
+axis2_status_t AXIS2_CALL
+axis2_options_set_soap_action(
+    axis2_options_t *options,
+    const axis2_env_t *env,
+    const axis2_char_t *soap_action);
+
+const axis2_char_t* AXIS2_CALL
+axis2_options_get_soap_action(
+    const axis2_options_t *options,
+    const axis2_env_t *env);
+
 axis2_options_t *AXIS2_CALL
 axis2_options_create(
     const axis2_env_t *env)
@@ -1196,6 +1208,12 @@
         options_impl->msg_info_headers = NULL;
     }
 
+    if (options_impl->soap_action)
+    {
+        AXIS2_FREE(env->allocator, options_impl->soap_action);
+        options_impl->soap_action = NULL;
+    }
+
     AXIS2_FREE(env->allocator, options_impl);
     options_impl = NULL;
 
@@ -1221,6 +1239,7 @@
     options_impl->manage_session = -1;
     options_impl->soap_version = AXIOM_SOAP12;
     options_impl->enable_mtom = AXIS2_FALSE;
+    options_impl->soap_action = NULL;
 }
 
 static void
@@ -1273,6 +1292,8 @@
     options->ops->get_soap_version = axis2_options_get_soap_version;
     options->ops->set_enable_mtom = axis2_options_set_enable_mtom;
     options->ops->get_enable_mtom = axis2_options_get_enable_mtom;
+    options->ops->set_soap_action = axis2_options_set_soap_action;
+    options->ops->get_soap_action = axis2_options_get_soap_action;
     options->ops->free = axis2_options_free;
 }
 
@@ -1342,3 +1363,42 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     return AXIS2_INTF_TO_IMPL(options)->enable_mtom;
 }
+
+const axis2_char_t* AXIS2_CALL
+axis2_options_get_soap_action(
+    const axis2_options_t *options,
+    const axis2_env_t *env)
+{
+    axis2_options_impl_t *options_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+
+    options_impl = AXIS2_INTF_TO_IMPL(options);
+
+    return options_impl->soap_action;
+}
+
+axis2_status_t AXIS2_CALL 
+axis2_options_set_soap_action(
+    axis2_options_t *options,
+    const axis2_env_t *env,
+    const axis2_char_t *soap_action)
+{
+    axis2_options_impl_t *options_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    options_impl = AXIS2_INTF_TO_IMPL(options);
+
+    if (options_impl->soap_action)
+    {
+        AXIS2_FREE(env->allocator, options_impl->soap_action);
+        options_impl->soap_action = NULL;
+    }
+
+    if (soap_action)
+    {
+        options_impl->soap_action = axis2_strdup(soap_action, env);
+    }
+    return AXIS2_SUCCESS;
+}
+
+

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=483075&r1=483074&r2=483075
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Wed Dec  6 05:40:39 2006
@@ -2175,6 +2175,7 @@
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
+
     return AXIS2_INTF_TO_IMPL(msg_ctx)->soap_action;
 }
 
@@ -2475,6 +2476,7 @@
     axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
     axis2_property_t *rest_val = NULL;
 	axis2_char_t *value;
+	const axis2_char_t *soap_action = NULL;;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, options, AXIS2_FAILURE);
@@ -2503,6 +2505,18 @@
 			if (AXIS2_STRCMP(value, AXIS2_VALUE_TRUE) == 0)
 				AXIS2_MSG_CTX_SET_DOING_REST(msg_ctx, env, AXIS2_TRUE);
 		}
+    }
+
+    if (msg_ctx_impl->soap_action)
+    {
+        AXIS2_FREE(env->allocator, msg_ctx_impl->soap_action);
+        msg_ctx_impl->soap_action = NULL;
+    }
+    
+    soap_action = AXIS2_OPTIONS_GET_SOAP_ACTION(options, env);
+    if (AXIS2_OPTIONS_GET_SOAP_ACTION(options, env))
+    {
+        msg_ctx_impl->soap_action = AXIS2_STRDUP(soap_action, env);
     }
 
     return AXIS2_SUCCESS;

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=483075&r1=483074&r2=483075
==============================================================================
--- 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 Dec  6 05:40:39 2006
@@ -578,14 +578,14 @@
     AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE);
 
     url = AXIS2_ENDPOINT_REF_GET_ADDRESS(epr, env);
-    /*hack if (NULL == soap_action || 0 == AXIS2_STRLEN(soap_action))
-    {
-        soap_action = AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env);
-    }*/
+    
+    soap_action = AXIS2_MSG_CTX_GET_SOAP_ACTION(msg_ctx, env);
+    
     if (NULL == soap_action)
     {
         soap_action = "";
     }
+    
     if (AXIS2_TRUE == AXIS2_MSG_CTX_GET_DOING_REST(msg_ctx, env))
     {
         axiom_node_t *data_out = NULL;

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=483075&r1=483074&r2=483075
==============================================================================
--- 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 Dec  6 05:40:39 2006
@@ -53,6 +53,7 @@
     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");
 
     /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
      * using the axis2.xml file.



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