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/12/03 23:04:37 UTC
svn commit: r481943 - in /webservices/axis2/trunk/c:
include/axis2_http_transport.h
modules/core/transport/http/sender/rest_sender.c
rampart/src/handlers/rampart_out_handler.c
Author: dinesh
Date: Sun Dec 3 14:04:36 2006
New Revision: 481943
URL: http://svn.apache.org/viewvc?view=rev&rev=481943
Log:
setting user specified http headers into request. remove unused varaible from rampart
Modified:
webservices/axis2/trunk/c/include/axis2_http_transport.h
webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c
webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport.h?view=diff&rev=481943&r1=481942&r2=481943
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Sun Dec 3 14:04:36 2006
@@ -413,6 +413,12 @@
*/
#define AXIS2_HTTP_METHOD "HTTP_METHOD"
+/**
+ *Constant for HTTP headers that user specify, Those headers will
+ *provided as property to the message context.
+ */
+#define AXIS2_HTTP_HEADER_PROPERTY "HTTP_HEADER_PROPERTY"
+
/** @} */
#ifdef __cplusplus
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=481943&r1=481942&r2=481943
==============================================================================
--- 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 Sun Dec 3 14:04:36 2006
@@ -212,6 +212,8 @@
axis2_hash_t *content_type_hash;
char *content_type_value = NULL;
axis2_property_t *content_type_property;
+ axis2_property_t *http_header_property;
+ axis2_array_list_t *http_header_list;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
@@ -374,6 +376,28 @@
axis2_rest_sender_get_timeout_values(sender, env, msg_ctx);
AXIS2_HTTP_CLIENT_SET_TIMEOUT(sender_impl->client, env,
sender_impl->so_timeout);
+
+ /**
+ *If user need to add http headers to request, Need to create
+ *array list with http headers and set it as a propety with name
+ *AXIS2_HTTP_HEADER_PROPERTY
+ */
+ http_header_property = (axis2_property_t *)AXIS2_MSG_CTX_GET_PROPERTY(
+ msg_ctx, env,
+ AXIS2_HTTP_HEADER_PROPERTY,
+ AXIS2_FALSE);
+ if (http_header_property)
+ {
+ http_header_list = (axis2_array_list_t *) AXIS2_PROPERTY_GET_VALUE (http_header_property, env);
+ if (!AXIS2_ARRAY_LIST_IS_EMPTY (http_header_list, env))
+ {
+ int i;
+ for (i = 0; i < AXIS2_ARRAY_LIST_SIZE (http_header_list, env); i++)
+ {
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER (request, env, (axis2_http_header_t *)AXIS2_ARRAY_LIST_GET (http_header_list, env, i));
+ }
+ }
+ }
status_code = AXIS2_HTTP_CLIENT_SEND(sender_impl->client, env, request);
Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c?view=diff&rev=481943&r1=481942&r2=481943
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c Sun Dec 3 14:04:36 2006
@@ -89,7 +89,6 @@
rampart_out_handler_invoke(struct axis2_handler * handler,
const axis2_env_t * env, axis2_msg_ctx_t * msg_ctx)
{
- axis2_msg_info_headers_t *msg_info_headers = NULL;
axis2_ctx_t *ctx = NULL;
axiom_soap_envelope_t *soap_envelope = NULL;
axiom_soap_header_t *soap_header = NULL;
@@ -104,9 +103,6 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
-
- msg_info_headers = AXIS2_MSG_CTX_GET_MSG_INFO_HEADERS(msg_ctx, env);
-
soap_envelope = AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env);
if (!soap_envelope)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org