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 di...@apache.org on 2006/11/21 09:37:57 UTC
svn commit: r477577 - in /webservices/axis2/trunk/c:
modules/core/context/msg_ctx.c
modules/core/transport/http/sender/rest_sender.c
samples/user_guide/clients/echo_rest.c
Author: dinesh
Date: Tue Nov 21 00:37:56 2006
New Revision: 477577
URL: http://svn.apache.org/viewvc?view=rev&rev=477577
Log:
fixed:axis2c-417 echo -mGET sends post request
Modified:
webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c
webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c
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=477577&r1=477576&r2=477577
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Tue Nov 21 00:37:56 2006
@@ -2472,7 +2472,8 @@
axis2_options_t *options)
{
axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
- axis2_char_t *rest_val = NULL;
+ axis2_property_t *rest_val = NULL;
+ axis2_char_t *value;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, options, AXIS2_FAILURE);
@@ -2491,12 +2492,16 @@
AXIS2_CTX_SET_NON_PERSISTANT_MAP(msg_ctx_impl->base, env,
AXIS2_OPTIONS_GET_PROPERTIES(options, env));
- rest_val = (axis2_char_t *)AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
+ rest_val = (axis2_property_t *) AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
AXIS2_ENABLE_REST, AXIS2_FALSE);
if (rest_val)
{
- if (AXIS2_STRCMP(rest_val, AXIS2_VALUE_TRUE) == 0)
- msg_ctx_impl->doing_rest = AXIS2_TRUE;
+ value = (axis2_char_t *)AXIS2_PROPERTY_GET_VALUE(rest_val, env);
+ if (value)
+ {
+ if (AXIS2_STRCMP(value, AXIS2_VALUE_TRUE) == 0)
+ AXIS2_MSG_CTX_SET_DOING_REST(msg_ctx, env, AXIS2_TRUE);
+ }
}
return AXIS2_SUCCESS;
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c?view=diff&rev=477577&r1=477576&r2=477577
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c Tue Nov 21 00:37:56 2006
@@ -207,7 +207,8 @@
const axis2_char_t *content_type = NULL;
axis2_property_t *property = NULL;
axis2_bool_t send_via_get = AXIS2_FALSE;
- axis2_char_t *method = NULL;
+ axis2_property_t *method = NULL;
+ axis2_char_t *method_value = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
@@ -243,11 +244,13 @@
AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_HTTP_CLIENT,
property, AXIS2_TRUE);
- method = (axis2_char_t *)AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
+ method = (axis2_property_t *)AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
AXIS2_HTTP_METHOD, AXIS2_FALSE);
+ if (method)
+ method_value = (axis2_char_t *) AXIS2_PROPERTY_GET_VALUE (method, env);
/* The default is POST */
- if (method && 0 == AXIS2_STRCMP(method, AXIS2_HTTP_HEADER_GET))
+ if (method_value && 0 == AXIS2_STRCMP(method_value, AXIS2_HTTP_HEADER_GET))
{
send_via_get = AXIS2_TRUE;
}
Modified: webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c?view=diff&rev=477577&r1=477576&r2=477577
==============================================================================
--- webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c (original)
+++ webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c Tue Nov 21 00:37:56 2006
@@ -32,6 +32,7 @@
axiom_node_t *ret_node = NULL;
axis2_bool_t method_get = AXIS2_FALSE;
axis2_property_t *rest_property = NULL;
+ axis2_property_t *get_property = NULL;
/* Set up the environment */
env = axis2_env_create_all("echo_rest.log", AXIS2_LOG_LEVEL_TRACE);
@@ -79,16 +80,15 @@
AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
/* Enable REST at the client side */
rest_property = axis2_property_create(env);
- AXIS2_PROPERTY_SET_VALUE(rest_property, env, axis2_strdup(AXIS2_VALUE_TRUE, env));
+ AXIS2_PROPERTY_SET_VALUE(rest_property, env, axis2_strdup (AXIS2_VALUE_TRUE, env));
AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_ENABLE_REST,
rest_property);
- rest_property = NULL;
if (AXIS2_TRUE == method_get)
{
- rest_property = axis2_property_create(env);
- AXIS2_PROPERTY_SET_VALUE(rest_property, env, axis2_strdup(AXIS2_HTTP_HEADER_GET, env));
+ get_property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_VALUE(get_property, env, axis2_strdup(AXIS2_HTTP_HEADER_GET, env));
AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_HTTP_METHOD,
- rest_property);
+ get_property);
}
/* 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