3 Replies Latest reply on Jan 9, 2009 2:54 PM by Dave Stanley

    UTF-8 encoding problem using FUSE to call CXF webservice

    Koen Maes Newbie

      Hi,

       

      We have on one hand :

      • a CXF webservice deployed on Tomcat

      and for FUSE :

      • a SU with CXF provider and consumer

      • a SU with CAMEL routing from consumer to provider

      • a SA to deploy both

       

      So basically, FUSE is forwarding our CXF requests to the external tomcat.

       

      When calling the webservice on Tomcat directly, the webservice works fine. When going through Fuse, we get an error on the external tomcat :

      java.io.IOException: Invalid character set UTF-8, text/xml in request.

      .org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:271)

      .org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:82)

       

      When I look at what is exactly communicated on http level (using wireshark), I notice that when using FUSE the HTTP-header "Content-Type" is repeated without charset: UTF-8 !!

       

      So this is sent to tomcat when calling directly (bypassing fuse) :

       

      POST /plato-sso/remoting/ssoWebservice HTTP/1.1 Content-Type: text/xml; charset=UTF-8

      SOAPAction: ""

      Accept: *

      Cache-Control: no-cache

      Pragma: no-cache

      User-Agent: Java/1.6.0_10

      Host: 10.253.201.219

      Connection: keep-alive

      Content-Length: 175

       

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:synchronizeUsers xmlns:ns1="http://ssowebservice.vsko.be/" /></soap:Body></soap:Envelope>

       

      Here is what is sent by fuse to external Tomcat:

       

      POST /plato-sso/remoting/ssoWebservice HTTP/1.1 Content-Type: text/xml; charset=UTF-8

      SOAPAction: "" Content-Type: text/xml

      Accept: *

      Cache-Control: no-cache

      Pragma: no-cache

      User-Agent: Java/1.6.0_10

      Host: athena.vsko.be

      Connection: keep-alive

      Transfer-Encoding: chunked

       

      112

       

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ns1:synchronizeUsers xmlns:ns1="http://ssowebservice.vsko.be/" /></soap:Body></soap:Envelope>

      0

       

      When using  FUSE, Tomcat throws an exception: Invalid character set UTF-8

      Any help very much appreciated !

       

      Koen

       

      Edited by: koma on Dec 15, 2008 11:52 AM

       

      Edited by: koma on Dec 15, 2008 5:08 PM

       

      Edited by: koma on Dec 15, 2008 5:10 PM

       

      Edited by: koma on Dec 15, 2008 5:10 PM