axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r373786 - /webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
Date Tue, 31 Jan 2006 10:06:48 GMT
Author: sahan
Date: Tue Jan 31 02:06:37 2006
New Revision: 373786

URL: http://svn.apache.org/viewcvs?rev=373786&view=rev
Log:
content type header setting added

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c?rev=373786&r1=373785&r2=373786&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c Tue
Jan 31 02:06:37 2006
@@ -175,6 +175,7 @@
 	int status_code = -1;
 	axis2_http_header_t *http_header = NULL;
 	axis2_http_simple_response_t *response = NULL;
+	axis2_char_t *content_type = NULL;
 		
     AXIS2_FUNC_PARAM_CHECK(sender, env, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
@@ -226,7 +227,6 @@
 	http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_SOAP_ACTION, 
 						soap_action);
 	AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
-	AXIS2_HTTP_SIMPLE_REQUEST_SET_BODY_STRING(request, env, buffer);
 	if(AXIS2_FALSE == sender_impl->chunked)
 	{
 		axis2_char_t tmp_buf[10];
@@ -235,6 +235,19 @@
 						AXIS2_HTTP_HEADER_CONTENT_LENGTH, tmp_buf);
 		AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
 	}
+	/* TODO we need to set the content type with soap action header for soap12*/
+	if(AXIS2_TRUE == AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
+	{
+		content_type = AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML;
+	}
+	else
+	{
+		content_type = AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP;
+	}
+	http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_CONTENT_TYPE, 
+						content_type);
+	AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+	AXIS2_HTTP_SIMPLE_REQUEST_SET_BODY_STRING(request, env, buffer);
 	axis2_soap_over_http_sender_get_timeout_values(sender, env, msg_ctx);
 	AXIS2_HTTP_CLIENT_SET_TIMEOUT(sender_impl->client, env, 
 						sender_impl->so_timeout);



Mime
View raw message