Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 39242 invoked from network); 9 Jan 2006 06:24:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Jan 2006 06:24:22 -0000 Received: (qmail 88714 invoked by uid 500); 9 Jan 2006 06:24:22 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 88644 invoked by uid 500); 9 Jan 2006 06:24:21 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 88624 invoked by uid 99); 9 Jan 2006 06:24:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jan 2006 22:24:21 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [209.68.5.15] (HELO relay01.pair.com) (209.68.5.15) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 08 Jan 2006 22:24:20 -0800 Received: (qmail 73448 invoked from network); 9 Jan 2006 06:23:55 -0000 Received: from unknown (HELO ?192.168.1.106?) (unknown) by unknown with SMTP; 9 Jan 2006 06:23:55 -0000 X-pair-Authenticated: 222.165.171.230 Message-ID: <43C20193.6000009@wso2.com> Date: Mon, 09 Jan 2006 12:24:19 +0600 From: Sahan Gamage User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache AXIS C Developers List Subject: [Axis2] Changes in the http transport module X-Enigmail-Version: 0.93.0.0 Content-Type: multipart/mixed; boundary="------------040504080302020506020807" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------040504080302020506020807 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have done some modifications to the http_transport module. Pls apply the patch and commit the code. - - Sahan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iQEVAwUBQ8IBkqnIlEsDdb85AQLSIwf/UWb/V6HMKPasW12eGuX25tHmXRSbrwa2 5I4pkQN/k87KB4Zq1wm/NUkVSSeqSkcCWaBxDbLzDSnfKPEoPP4WkPc7XdbeIoSe pvFwMQWFFMNyJlhAID+n9hy2xmgWgYSPu6WacXaaSkk6f1sgqWBsInc5B95jI6wT A1hdUoIxXFfIZd0c3LDPSzrczOFWYCdFu+4DnUcme6PYpRnUrqqg5nbH4hqNZhgE ZtF9S/Nqxts9r+Vo61cylV5Nc2JyGLpA4p9EcBR2UwMXh76CPRfkQbJ+dfrs4VT8 9gNofUiSqKHFRiClCqS77lb5zsmmTPnK+Z/XlPHk05ZCnc44wWg+5w== =XOwV -----END PGP SIGNATURE----- --------------040504080302020506020807 Content-Type: text/plain; name="axis2_core_transport_http_patch_09_01_2006" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="axis2_core_transport_http_patch_09_01_2006" Index: axis2_soap_over_http_sender.c =================================================================== --- axis2_soap_over_http_sender.c (revision 367208) +++ axis2_soap_over_http_sender.c (working copy) @@ -63,7 +63,7 @@ axis2_soap_over_http_sender_send (axis2_soap_over_http_sender_t *sender, axis2_env_t **env, axis2_msg_ctx_t *msg_ctx, - axis2_om_node_t *output, axis2_char_t *url, + axis2_om_node_t *output, axis2_char_t *str_url, axis2_char_t *soap_action); axis2_status_t AXIS2_CALL @@ -157,18 +157,39 @@ axis2_soap_over_http_sender_send (axis2_soap_over_http_sender_t *sender, axis2_env_t **env, axis2_msg_ctx_t *msg_ctx, - axis2_om_node_t *output, axis2_char_t *url, + axis2_om_node_t *output, axis2_char_t *str_url, axis2_char_t *soap_action) { + axis2_http_client_t *client = NULL; + axis2_http_simple_request_t *request = NULL; + axis2_http_request_line_t *requst_line = NULL; + axis2_url_t *url = NULL; + axis2_soap_over_http_sender_impl_t *sender_impl = NULL; + AXIS2_FUNC_PARAM_CHECK(sender, env, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, output, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, url, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, soap_action, AXIS2_FAILURE); + url = axis2_url_parse_string(env, str_url); + sender_impl = AXIS2_INTF_TO_IMPL(sender); + if(NULL == url) + { + reuturn AXIS2_FAILURE; + } + client = axis2_http_client_create(env, url); + if(NULL == client) + { + return AXIS2_FAILURE; + } + axis2_soap_over_http_sender_get_timeout_values(sender, env, msg_ctx); + AXIS2_HTTP_CLIENT_SET_TIMEOUT(client, env, sender_impl->so_timeout); + /* * TODO create the http client and send - */ + */ + return AXIS2_SUCCESS; } Index: axis2_http_request_line.c =================================================================== --- axis2_http_request_line.c (revision 367208) +++ axis2_http_request_line.c (working copy) @@ -252,7 +252,7 @@ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } - sprintf(ret, "%s %s %s %s", req_line_impl->method, req_line_impl->uri, + sprintf(ret, "%s %s %s%s", req_line_impl->method, req_line_impl->uri, req_line_impl->http_version, AXIS2_HTTP_CRLF); return ret; } Index: axis2_http_simple_request.c =================================================================== --- axis2_http_simple_request.c (revision 367208) +++ axis2_http_simple_request.c (working copy) @@ -97,7 +97,7 @@ axis2_ssize_t AXIS2_CALL axis2_http_simple_request_get_body_bytes (axis2_http_simple_request_t *simple_request, - axis2_env_t **env, axis2_char_t *buf); + axis2_env_t **env, char **buf); axis2_status_t AXIS2_CALL axis2_http_simple_request_free(axis2_http_simple_request_t *simple_request, @@ -452,11 +452,50 @@ axis2_ssize_t AXIS2_CALL axis2_http_simple_request_get_body_bytes (axis2_http_simple_request_t *simple_request, - axis2_env_t **env, axis2_char_t *buf) + axis2_env_t **env, char **buf) { + axis2_stream_t *body = NULL; + char *tmp_buf = NULL; + char *tmp_buf2 = NULL; + char *tmp_buf3 = NULL; + int length = 0; + int read_len = 0; + AXIS2_FUNC_PARAM_CHECK(simple_request, env, AXIS2_FAILURE); + + body = AXIS2_INTF_TO_IMPL(simple_request)->stream; + if(NULL == body) + { + *buf = (char*)AXIS2_MALLOC((*env)->allocator, 1); + *buf[0] = '\0'; + return 0; + } + length = AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_LENGTH(simple_request, env); + if(length > 0) + { + *buf = (char*)AXIS2_MALLOC((*env)->allocator, length); + read_len = AXIS2_STREAM_READ(body, env, buf, length); + return read_len; + } + tmp_buf2 = AXIS2_MALLOC((*env)->allocator, 128 * sizeof(char)); + while(AXIS2_STREAM_READ(body, env, tmp_buf2, 128) > 0) + { + tmp_buf3 = AXIS2_STRACAT(tmp_buf, tmp_buf2, env); + if(NULL != tmp_buf) + { + AXIS2_FREE((*env)->allocator, tmp_buf); + tmp_buf = NULL; + } + tmp_buf = tmp_buf3; + + } /* - TODO stream dependent + TODO :STREAM_READ => STREAM_READ_BYTES */ + if(NULL != tmp_buf) + { + *buf = tmp_buf; + return AXIS2_STRLEN(tmp_buf); + } return -1; } Index: axis2_http_simple_response.c =================================================================== --- axis2_http_simple_response.c (revision 367208) +++ axis2_http_simple_response.c (working copy) @@ -123,7 +123,7 @@ axis2_ssize_t AXIS2_CALL axis2_http_simple_response_get_body_bytes (axis2_http_simple_response_t *simple_response, - axis2_env_t **env, axis2_char_t *buf); + axis2_env_t **env, axis2_char_t **buf); axis2_status_t AXIS2_CALL axis2_http_simple_response_free (axis2_http_simple_response_t *simple_response, @@ -191,6 +191,10 @@ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } + simple_response_impl->status_line = NULL; + simple_response_impl->header_group = NULL; + simple_response_impl->stream = NULL; + simple_response_impl->simple_response.ops->set_status_line = axis2_http_simple_response_set_status_line; simple_response_impl->simple_response.ops->get_phrase = @@ -250,9 +254,12 @@ for(i = 0; i< AXIS2_ARRAY_LIST_SIZE(simple_response_impl->header_group, env); i++) { - tmp = (axis2_http_header_t *)AXIS2_ARRAY_LIST_REMOVE( + tmp = (axis2_http_header_t *)AXIS2_ARRAY_LIST_GET( simple_response_impl->header_group, env, i); - AXIS2_HTTP_HEADER_FREE(tmp, env); + if(NULL != tmp) + { + AXIS2_HTTP_HEADER_FREE(tmp, env); + } } AXIS2_ARRAY_LIST_FREE(simple_response_impl->header_group, env); simple_response_impl->header_group = NULL; @@ -262,7 +269,7 @@ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(simple_response)); /* Stream is not freed - * Assumption : stream doesn't belong to the reaponse + * Assumption : stream doesn't belong to the response */ return AXIS2_SUCCESS; } @@ -456,6 +463,12 @@ (axis2_http_simple_response_t *simple_response, axis2_env_t **env, axis2_http_header_t* header) { + int i = 0; + int count = 0; + axis2_http_header_t *tmp_header = NULL; + axis2_char_t *tmp_name = NULL; + axis2_array_list_t *header_group = NULL; + AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, header, AXIS2_FAILURE); @@ -464,7 +477,7 @@ if(NULL == simple_response_impl->header_group) { - simple_response_impl->header_group = axis2_array_list_create(env, 1); + simple_response_impl->header_group = axis2_array_list_create(env, 10); AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, header); return AXIS2_SUCCESS; } @@ -472,12 +485,9 @@ /* If a header with the same name exists * search and remove the old header */ - axis2_array_list_t *header_group = AXIS2_INTF_TO_IMPL(simple_response)-> - header_group; - int i = 0; - axis2_http_header_t *tmp_header = NULL; - axis2_char_t *tmp_name = NULL; - int count = AXIS2_ARRAY_LIST_SIZE(header_group, env); + header_group = AXIS2_INTF_TO_IMPL(simple_response)->header_group; + + count = AXIS2_ARRAY_LIST_SIZE(header_group, env); for(i = 0; i < count; i++) { tmp_header = (axis2_http_header_t *)AXIS2_ARRAY_LIST_GET(header_group, @@ -491,7 +501,8 @@ break; } } - AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, header); + AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, + (void*)header); return AXIS2_SUCCESS; } @@ -558,12 +569,21 @@ (axis2_http_simple_response_t *simple_response, axis2_env_t **env, axis2_char_t *str) { + axis2_stream_t *body_stream = NULL; AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); AXIS2_PARAM_CHECK((*env)->error, str, AXIS2_FAILURE); - /* - TODO stream dependent - */ + body_stream = AXIS2_INTF_TO_IMPL(simple_response)->stream; + if(NULL == body_stream) + { + body_stream = axis2_stream_create_basic(env); + if(NULL == body_stream) + { + return AXIS2_FAILURE; + } + AXIS2_INTF_TO_IMPL(simple_response)->stream = body_stream; + } + AXIS2_STREAM_WRITE(body_stream, env, str, AXIS2_STRLEN(str)); return AXIS2_SUCCESS; } @@ -573,7 +593,6 @@ axis2_env_t **env, axis2_stream_t *stream) { AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); - AXIS2_PARAM_CHECK((*env)->error, stream, AXIS2_FAILURE); /* * TODO do we have to free the existing stream * Problem in freeing is most of the time the stream doesn't belong @@ -598,11 +617,81 @@ axis2_ssize_t AXIS2_CALL axis2_http_simple_response_get_body_bytes (axis2_http_simple_response_t *simple_response, - axis2_env_t **env, axis2_char_t *buf) + axis2_env_t **env, axis2_char_t **buffer) { - AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); - /* - TODO stream dependent - */ - return -1; + axis2_http_simple_response_impl_t *response_impl = NULL; + axis2_stream_t *tmp_stream = NULL; + AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); + int return_size = -1; + + response_impl = AXIS2_INTF_TO_IMPL(simple_response); + if(NULL == response_impl->stream) + { + AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NULL_BODY, AXIS2_FAILURE); + return -1; + } + tmp_stream = axis2_stream_create_basic(env); + while(1) + { + int read = 0; + int write = 0; + int READ_SIZE = 32; + char buf[READ_SIZE]; + read = AXIS2_STREAM_READ(response_impl->stream, env, buf, READ_SIZE); + if(read < 0) + { + break; + } + write = AXIS2_STREAM_WRITE(tmp_stream, env, buf, read); + if(read < READ_SIZE) + { + break; + } + } + return_size = AXIS2_STREAM_BASIC_GET_LEN(tmp_stream, env); + + if(return_size > 0) + { + *buffer = (char *)AXIS2_MALLOC((*env)->allocator, sizeof(char)* + (return_size +1)); + return_size = AXIS2_STREAM_READ(tmp_stream, env, *buffer, + return_size + 1); + } + AXIS2_STREAM_FREE(tmp_stream, env); + return return_size; } + +axis2_bool_t AXIS2_CALL +axis2_http_simple_response_contains_header + (axis2_http_simple_response_t *simple_response, + axis2_env_t **env, axis2_char_t *name) +{ + axis2_char_t *header_name = NULL; + axis2_http_simple_response_impl_t *simple_response_impl = NULL; + int count = 0; + int i = 0; + + AXIS2_FUNC_PARAM_CHECK(simple_response, env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE); + simple_response_impl = AXIS2_INTF_TO_IMPL( + simple_response); + if(NULL == simple_response_impl->header_group) + { + return AXIS2_FALSE; + } + count = AXIS2_ARRAY_LIST_SIZE(simple_response_impl->header_group, env); + if(0 == count) + { + return AXIS2_FALSE; + } + + for(i = 0; i < count; i++) + { + header_name = AXIS2_HTTP_HEADER_GET_NAME((axis2_http_header_t *) + AXIS2_ARRAY_LIST_GET(simple_response_impl->header_group, + env, i), env); + if(0 == AXIS2_STRCASECMP(name,header_name)) + return AXIS2_TRUE; + } + return AXIS2_FALSE; +} Index: axis2_http_worker.c =================================================================== --- axis2_http_worker.c (revision 367208) +++ axis2_http_worker.c (working copy) @@ -128,8 +128,7 @@ axis2_conf_ctx_t *conf_ctx = http_worker_impl->conf_ctx; axis2_msg_ctx_t *msg_ctx = NULL; axis2_stream_t *request_body = NULL; - axis2_stream_t *out_stream = axis2_stream_create(env, (*env)->allocator, - NULL); + axis2_stream_t *out_stream = axis2_stream_create_basic(env); axis2_http_simple_response_t *response = NULL; axis2_transport_out_desc_t *out_desc = NULL; axis2_transport_in_desc_t *in_desc = NULL; @@ -232,7 +231,7 @@ simple_request, env), env), AXIS2_HTTP_HEADER_POST)) { processed = axis2_http_transport_utils_process_http_post_request - (env, msg_ctx, request_body, + (env, msg_ctx, request_body, out_stream, AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_TYPE( simple_request, env) ,soap_action, AXIS2_HTTP_REQUEST_LINE_GET_URI @@ -257,7 +256,7 @@ } AXIS2_HTTP_SIMPLE_RESPONSE_SET_BODY_STREAM(response, env, out_stream); axis2_http_worker_set_response_headers(http_worker, env, svr_conn, - simple_request, response, AXIS2_STREAM_GET_LEN( + simple_request, response, AXIS2_STREAM_BASIC_GET_LEN( out_stream, env)); /* Index: axis2_http_transport_utils.c =================================================================== --- axis2_http_transport_utils.c (revision 367208) +++ axis2_http_transport_utils.c (working copy) @@ -20,13 +20,15 @@ #include #include #include +#include /***************************** Function headers *******************************/ -axis2_status_t AXIS2_CALL +axis2_status_t AXIS2_CALL axis2_http_transport_utils_process_http_post_request (axis2_env_t **env, axis2_msg_ctx_t *msg_ctx, - axis2_stream_t *stream, axis2_char_t *content_type, + axis2_stream_t *in_stream, axis2_stream_t *out_stream, + axis2_char_t *content_type, axis2_char_t *soap_action_header, axis2_char_t *request_uri); @@ -81,11 +83,39 @@ axis2_status_t AXIS2_CALL axis2_http_transport_utils_process_http_post_request (axis2_env_t **env, axis2_msg_ctx_t *msg_ctx, - axis2_stream_t *stream, axis2_char_t *content_type, + axis2_stream_t *in_stream, axis2_stream_t *out_stream, + axis2_char_t *content_type, axis2_char_t *soap_action_header, axis2_char_t *request_uri) { - /* + AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE); + AXIS2_PARAM_CHECK((*env)->error, in_stream, AXIS2_FAILURE); + AXIS2_PARAM_CHECK((*env)->error, out_stream, AXIS2_FAILURE); + AXIS2_PARAM_CHECK((*env)->error, content_type, AXIS2_FAILURE); + AXIS2_PARAM_CHECK((*env)->error, request_uri, AXIS2_FAILURE); + if(NULL != soap_action_header) + { + /* remove leading and trailing " s */ + if('"' == soap_action_header[0]) + { + memmove(soap_action_header, soap_action_header+sizeof(axis2_char_t), + strlen(soap_action_header) + sizeof(axis2_char_t)); + } + if('"' == soap_action_header[strlen(soap_action_header) -1]) + { + soap_action_header[strlen(soap_action_header) -1] = '\0'; + } + AXIS2_MSG_CTX_SET_WSA_ACTION(msg_ctx, env, soap_action_header); + AXIS2_MSG_CTX_SET_SOAP_ACTION(msg_ctx, env, soap_action_header); + AXIS2_MSG_CTX_SET_TO(msg_ctx, env, axis2_endpoint_ref_create(env, + request_uri)); + AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, + AXIS2_TRANSPORT_OUT, out_stream, AXIS2_FALSE); + AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE); + + + } + /* TODO code */ return AXIS2_SUCCESS; @@ -372,3 +402,25 @@ return tmp2; } + +axis2_char_t* AXIS2_CALL +axis2_http_transport_utils_get_charset_enc(axis2_env_t **env, + axis2_char_t *content_type) +{ + axis2_char_t *tmp = NULL; + + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK((*env)->error, content_type, NULL); + + tmp = strstr(content_type, AXIS2_HTTP_CHAR_SET_ENCODING); + if(NULL == tmp) + { + return AXIS2_STRDUP(AXIS2_HTTP_HEADER_DEFAULT_CHAR_ENCODING, env); + } + tmp = strchr(tmp, '='); + if(NULL == tmp) + { + return AXIS2_STRDUP(AXIS2_HTTP_HEADER_DEFAULT_CHAR_ENCODING, env); + } + return AXIS2_STRDUP(tmp, env); +} Index: Makefile.am =================================================================== --- Makefile.am (revision 367208) +++ Makefile.am (working copy) @@ -1,13 +1,17 @@ lib_LTLIBRARIES = libaxis2_http_transport.la AM_CPPFLAGS = $(CPPFLAGS) libaxis2_http_transport_la_SOURCES = axis2_http_worker.c \ + axis2_http_transport_utils.c\ axis2_simple_http_svr_conn.c\ axis2_http_simple_request.c\ axis2_http_simple_response.c\ axis2_http_response_writer.c\ axis2_http_request_line.c\ axis2_http_status_line.c\ - axis2_http_header.c + axis2_http_header.c\ + axis2_url.c\ + axis2_http_out_transport_info.c\ + axis2_http_client.c INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/modules/util \ Index: axis2_http_header.c =================================================================== --- axis2_http_header.c (revision 367208) +++ axis2_http_header.c (working copy) @@ -16,6 +16,7 @@ #include #include +#include /** @@ -90,6 +91,35 @@ return &(http_header_impl->http_header); } +AXIS2_DECLARE(axis2_http_header_t *) AXIS2_CALL +axis2_http_header_create_by_str (axis2_env_t **env, axis2_char_t *str) +{ + axis2_char_t *tmp_str = NULL; + axis2_char_t *ch = NULL; + axis2_char_t *ch2 = NULL; + axis2_http_header_t *ret = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_FUNC_PARAM_CHECK(str, env, NULL); + + tmp_str = AXIS2_STRDUP(str, env); + if(NULL == tmp_str) + { + return NULL; + } + ch = strchr(tmp_str, ':'); + if(NULL == ch) + { + AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_HEADER, + AXIS2_FAILURE); + AXIS2_FREE((*env)->allocator, tmp_str); + return NULL; + } + ch2 = ch + sizeof(axis2_char_t); + *ch = '\0'; + ret = axis2_http_header_create(env, tmp_str, ch2); + AXIS2_FREE((*env)->allocator, tmp_str); + return ret; +} axis2_status_t AXIS2_CALL axis2_http_header_free (axis2_http_header_t *header, axis2_env_t **env) @@ -122,11 +152,11 @@ AXIS2_FUNC_PARAM_CHECK(header, env, NULL); axis2_http_header_impl_t *http_header_impl = AXIS2_INTF_TO_IMPL(header); axis2_ssize_t len = AXIS2_STRLEN(http_header_impl->name) + - AXIS2_STRLEN(http_header_impl->value) + 2; + AXIS2_STRLEN(http_header_impl->value) + 4; axis2_char_t *external_form = (axis2_char_t*) AXIS2_MALLOC((*env)->allocator, len); - sprintf(external_form, "%s:%s", http_header_impl->name, - http_header_impl->value); + sprintf(external_form, "%s:%s%s", http_header_impl->name, + http_header_impl->value, AXIS2_HTTP_CRLF); return external_form; } --------------040504080302020506020807--