You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2006/12/06 17:48:12 UTC

svn commit: r483144 - in /webservices/axis2/trunk/c: modules/core/transport/http/http_out_transport_info.c samples/client/mtom/mtom_client.c

Author: samisa
Date: Wed Dec  6 08:48:11 2006
New Revision: 483144

URL: http://svn.apache.org/viewvc?view=rev&rev=483144
Log:
Fixed the charset problem when using MTOM on server side.
AXIS2C-431

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/http_out_transport_info.c
    webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_out_transport_info.c?view=diff&rev=483144&r1=483143&r2=483144
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_out_transport_info.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_out_transport_info.c Wed Dec  6 08:48:11 2006
@@ -146,14 +146,23 @@
 
     if (info_impl->encoding)
     {
-
-        tmp1 = AXIS2_STRACAT(content_type, ";charset=", env);
-        tmp2 = AXIS2_STRACAT(tmp1, info_impl->encoding, env);
-        AXIS2_HTTP_SIMPLE_RESPONSE_SET_HEADER(info_impl->response, env,
+        axis2_char_t *charset_pos = axis2_strcasestr(content_type, "charset");
+        if (!charset_pos)
+        {
+            tmp1 = AXIS2_STRACAT(content_type, ";charset=", env);
+            tmp2 = AXIS2_STRACAT(tmp1, info_impl->encoding, env);
+            AXIS2_HTTP_SIMPLE_RESPONSE_SET_HEADER(info_impl->response, env,
+                    axis2_http_header_create(env, AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                            tmp2));
+            AXIS2_FREE(env->allocator, tmp1);
+            AXIS2_FREE(env->allocator, tmp2);
+        }
+        else
+        {
+            AXIS2_HTTP_SIMPLE_RESPONSE_SET_HEADER(info_impl->response, env,
                 axis2_http_header_create(env, AXIS2_HTTP_HEADER_CONTENT_TYPE,
-                        tmp2));
-        AXIS2_FREE(env->allocator, tmp1);
-        AXIS2_FREE(env->allocator, tmp2);
+                        content_type));
+        }
     }
     else
     {

Modified: webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c?view=diff&rev=483144&r1=483143&r2=483144
==============================================================================
--- webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c Wed Dec  6 08:48:11 2006
@@ -39,7 +39,7 @@
     axiom_node_t *ret_node = NULL;
     const axis2_char_t *image_name = "resources/axis2.jpg";
     const axis2_char_t *to_save_name = "test.jpg";
-    axis2_endpoint_ref_t* reply_to = NULL;
+    /*axis2_endpoint_ref_t* reply_to = NULL;*/
     axis2_bool_t optimized = AXIS2_TRUE;
 
 
@@ -71,14 +71,14 @@
     /* Setup options */
     options = axis2_options_create(env);
     AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
-    AXIS2_OPTIONS_SET_USE_SEPARATE_LISTENER(options, env, AXIS2_TRUE);
+    /*AXIS2_OPTIONS_SET_USE_SEPARATE_LISTENER(options, env, AXIS2_TRUE);*/
     /* Seperate listner needs addressing, hence addressing stuff in options */
     AXIS2_OPTIONS_SET_ACTION(options, env,
             "http://ws.apache.org/axis2/c/samples/mtomSample");
-    reply_to = axis2_endpoint_ref_create(env,
+    /*reply_to = axis2_endpoint_ref_create(env,
             "http://localhost:6060/axis2/services/__ANONYMOUS_SERVICE__/__OPERATION_OUT_IN__");
 
-    AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);
+    AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to);*/
     AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP11);
     AXIS2_OPTIONS_SET_ENABLE_MTOM(options, env, AXIS2_TRUE);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org