--- Begin Message ---
Hi,
I have done some changes and additions in some files in the core and
tested with existing samples. Please see the attached diffs. Please
also see comments in
https://issues.apache.org/jira/browse/AXIS2C-324
If there are no objections I'll commit the changes
thanks
Damitha
Index: transport/http/sender/http_client.c
===================================================================
--- transport/http/sender/http_client.c (revision 454293)
+++ transport/http/sender/http_client.c (working copy)
@@ -48,6 +48,7 @@
axis2_char_t *proxy_host;
int proxy_port;
axis2_char_t *proxy_host_port;
+ axis2_bool_t dump_input_msg;
}
axis2_http_client_impl_t;
@@ -114,6 +115,12 @@
int port);
axis2_status_t AXIS2_CALL
+axis2_http_client_set_dump_input_msg(
+ axis2_http_client_t *client,
+ const axis2_env_t *env,
+ axis2_bool_t dump_input_msg);
+
+axis2_status_t AXIS2_CALL
axis2_http_client_free(
axis2_http_client_t *client,
const axis2_env_t *env);
@@ -152,6 +159,7 @@
http_client_impl->proxy_port = 0;
http_client_impl->proxy_host = NULL;
http_client_impl->proxy_host_port = NULL;
+ http_client_impl->dump_input_msg = AXIS2_FALSE;
http_client_impl->http_client.ops = AXIS2_MALLOC(env->allocator,
sizeof(axis2_http_client_ops_t));
@@ -177,6 +185,8 @@
axis2_http_client_set_proxy;
http_client_impl->http_client.ops->get_proxy =
axis2_http_client_get_proxy;
+ http_client_impl->http_client.ops->set_dump_input_msg =
+ axis2_http_client_set_dump_input_msg;
http_client_impl->http_client.ops->free = axis2_http_client_free;
return &(http_client_impl->http_client);
@@ -247,6 +257,16 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
client_impl = AXIS2_INTF_TO_IMPL(client);
+ body_size = AXIS2_HTTP_SIMPLE_REQUEST_GET_BODY_BYTES(request, env,
+ &str_body);
+ if(client_impl->dump_input_msg == AXIS2_TRUE)
+ {
+ /* We just print the input message and return */
+ printf("----------------Input message--------------:\n");
+ printf("%s\n", str_body);
+ return AXIS2_SUCCESS;
+ }
+
if (NULL == client_impl->url)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_URL, AXIS2_FAILURE);
@@ -399,8 +419,6 @@
wire_format = NULL;
written = AXIS2_STREAM_WRITE(client_impl->data_stream, env,
AXIS2_HTTP_CRLF,
2);
- body_size = AXIS2_HTTP_SIMPLE_REQUEST_GET_BODY_BYTES(request, env,
- &str_body);
if (body_size > 0 && str_body)
{
if (AXIS2_FALSE == chunking_enabled)
@@ -786,3 +804,19 @@
AXIS2_STREAM_FREE(tmp_stream, env);
return AXIS2_SUCCESS;
}
+
+axis2_status_t AXIS2_CALL
+axis2_http_client_set_dump_input_msg(
+ axis2_http_client_t *client,
+ const axis2_env_t *env,
+ axis2_bool_t dump_input_msg)
+{
+ axis2_http_client_impl_t *client_impl = NULL;
+
+ client_impl = AXIS2_INTF_TO_IMPL(client);
+
+ client_impl->dump_input_msg = dump_input_msg;
+
+ return AXIS2_SUCCESS;
+}
+
Index: transport/http/sender/soap_over_http_sender.c
===================================================================
--- transport/http/sender/soap_over_http_sender.c (revision 454293)
+++ transport/http/sender/soap_over_http_sender.c (working copy)
@@ -209,6 +209,7 @@
axis2_byte_t *output_stream = NULL;
int output_stream_size = 0;
axis2_bool_t doing_mtom = AXIS2_FALSE;
+ axis2_property_t *dump_property = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
@@ -234,6 +235,18 @@
{
return AXIS2_FAILURE;
}
+
+ dump_property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
+ AXIS2_DUMP_INPUT_MSG_TRUE, AXIS2_FALSE);
+ if(dump_property)
+ {
+ axis2_char_t *dump_true = AXIS2_PROPERTY_GET_VALUE(dump_property, env);
+ if(0 == AXIS2_STRCMP(dump_true, AXIS2_VALUE_TRUE))
+ {
+ AXIS2_HTTP_CLIENT_SET_DUMP_INPUT_MSG(sender_impl->client, env,
AXIS2_TRUE);
+ }
+ }
+
/* configure proxy settings if we have set so
*/
axis2_soap_over_http_sender_configure_proxy(sender, env, msg_ctx);
Index: clientapi/op_client.c
===================================================================
--- clientapi/op_client.c (revision 454293)
+++ clientapi/op_client.c (working copy)
@@ -405,7 +405,13 @@
if (!transport_out)
{
axis2_endpoint_ref_t *to_epr = NULL;
- to_epr = AXIS2_OPTIONS_GET_TO(op_client_impl->options, env);
+ axis2_property_t *property = NULL;
+ property = AXIS2_OPTIONS_GET_PROPERTY(op_client_impl->options, env,
+ AXIS2_TARGET_EPR);
+ if(property)
+ to_epr = AXIS2_PROPERTY_GET_VALUE(property, env);
+ if(!to_epr)
+ to_epr = AXIS2_OPTIONS_GET_TO(op_client_impl->options, env);
if (!to_epr)
to_epr = AXIS2_MSG_CTX_GET_TO(msg_ctx, env);
transport_out = AXIS2_MEP_CLIENT_INFER_TRANSPORT(op_client_impl->base,
env, to_epr);
@@ -724,17 +730,3 @@
return AXIS2_SUCCESS;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--- End Message ---