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 se...@apache.org on 2008/03/20 06:19:47 UTC
svn commit: r639161 - in /webservices/axis2/trunk/c:
include/axis2_http_simple_response.h include/axis2_msg_ctx.h
src/core/context/msg_ctx.c
src/core/transport/http/common/http_simple_response.c
src/core/transport/http/sender/http_sender.c
Author: senaka
Date: Wed Mar 19 22:19:47 2008
New Revision: 639161
URL: http://svn.apache.org/viewvc?rev=639161&view=rev
Log:
Improving the Client Side support for Retrieving HTTP Response Headers
Modified:
webservices/axis2/trunk/c/include/axis2_http_simple_response.h
webservices/axis2/trunk/c/include/axis2_msg_ctx.h
webservices/axis2/trunk/c/src/core/context/msg_ctx.c
webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
Modified: webservices/axis2/trunk/c/include/axis2_http_simple_response.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_simple_response.h?rev=639161&r1=639160&r2=639161&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_simple_response.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_simple_response.h Wed Mar 19 22:19:47 2008
@@ -127,6 +127,15 @@
/**
* @param simple_response pointer to simple response struct
* @param env pointer to environment struct
+ */
+ axutil_array_list_t *AXIS2_CALL
+ axis2_http_simple_response_extract_headers(
+ axis2_http_simple_response_t * simple_response,
+ const axutil_env_t * env);
+
+ /**
+ * @param simple_response pointer to simple response struct
+ * @param env pointer to environment struct
* @param str pointer to str
*/
AXIS2_EXTERN axis2_http_header_t *AXIS2_CALL
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?rev=639161&r1=639160&r2=639161&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Wed Mar 19 22:19:47 2008
@@ -2025,11 +2025,10 @@
const axutil_env_t * env);
/**
- * Sets the Output Header list
+ * Gets the Output Header list
* @param msg_ctx message context
* @param env pointer to environment struct
- * @param output_headers Output Header list
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ * @return Output Header list
*/
AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
axis2_msg_ctx_get_http_output_headers(
@@ -2037,10 +2036,23 @@
const axutil_env_t * env);
/**
- * Gets the Output Header list
+ * Retrieves the Output Headers, and removes them
+ * from the message context
* @param msg_ctx message context
* @param env pointer to environment struct
* @return Output Header list
+ */
+ AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+ axis2_msg_ctx_extract_http_output_headers(
+ axis2_msg_ctx_t * msg_ctx,
+ const axutil_env_t * env);
+
+ /**
+ * Sets the Output Header list
+ * @param msg_ctx message context
+ * @param env pointer to environment struct
+ * @param output_headers Output Header list
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_msg_ctx_set_http_output_headers(
Modified: webservices/axis2/trunk/c/src/core/context/msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/msg_ctx.c?rev=639161&r1=639160&r2=639161&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/msg_ctx.c Wed Mar 19 22:19:47 2008
@@ -2413,6 +2413,24 @@
}
}
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+axis2_msg_ctx_extract_http_output_headers(
+ axis2_msg_ctx_t * msg_ctx,
+ const axutil_env_t * env)
+{
+ if (msg_ctx)
+ {
+ axutil_array_list_t *temp = NULL;
+ temp = msg_ctx->output_headers;
+ msg_ctx->output_headers = NULL;
+ return temp;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_msg_ctx_set_http_output_headers(
axis2_msg_ctx_t * msg_ctx,
Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c?rev=639161&r1=639160&r2=639161&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c Wed Mar 19 22:19:47 2008
@@ -226,6 +226,20 @@
return simple_response->header_group;
}
+axutil_array_list_t *AXIS2_CALL
+axis2_http_simple_response_extract_headers(
+ axis2_http_simple_response_t * simple_response,
+ const axutil_env_t * env)
+{
+ axutil_array_list_t *temp = NULL;
+ temp = simple_response->header_group;
+ if (temp)
+ {
+ simple_response->header_group = NULL;
+ }
+ return temp;
+}
+
axis2_http_header_t *AXIS2_CALL
axis2_http_simple_response_get_first_header(
axis2_http_simple_response_t * simple_response,
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c?rev=639161&r1=639160&r2=639161&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c Wed Mar 19 22:19:47 2008
@@ -1116,7 +1116,12 @@
axis2_msg_ctx_set_status_code (msg_ctx, env, status_code);
response = axis2_http_client_get_response (sender->client, env);
- if (AXIS2_HTTP_RESPONSE_OK_CODE_VAL == status_code ||
+ if (!is_soap)
+ {
+ return axis2_http_sender_process_response (sender, env,
+ msg_ctx, response);
+ }
+ else if (AXIS2_HTTP_RESPONSE_OK_CODE_VAL == status_code ||
AXIS2_HTTP_RESPONSE_ACK_CODE_VAL == status_code)
{
return axis2_http_sender_process_response (sender, env,
@@ -1326,6 +1331,8 @@
}
axis2_http_sender_get_header_info (sender, env, msg_ctx, response);
+ axis2_msg_ctx_set_http_output_headers(msg_ctx, env,
+ axis2_http_simple_response_extract_headers(response, env));
/*axis_ctx = axis2_op_ctx_get_base( axis2_msg_ctx_get_op_ctx(msg_ctx, env),
env); */
property = axutil_property_create (env);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org