camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jannecamel <>
Subject Re: Trying to consume SOAP WS with UTF-8 content, getting "Invalid UTF-8 middle byte 0x3c"
Date Thu, 02 Jan 2014 09:40:50 GMT
Thanks. My route is a little bit different and I don't want to write the
request "by hand" like that. What I'm doing is:

  process(populateBeanProcessor). // 1
  marshal(soapJaxbDataFormat). // 2
  to(fooService). // 3

1 = processor creates a JAXB bean which represents my request
2 = JAXB bean is converted into SOAP XML message
3 = we call web service

I ended up writing a CXF interceptor for setting the http header:

public class Utf8SoapRequestInterceptor extends
AbstractPhaseInterceptor<Message> {
    public Utf8SoapRequestInterceptor() {
    public void handleMessage(Message message) throws Fault {
        Map<String, List> headers = (Map<String, List>)
        try {
        } catch (Exception ce) {
            throw new Fault(ce);

<camelcxf:cxfEndpoint id="fooService"
        <bean class="bla.Utf8SoapRequestInterceptor" />
        <entry key="dataFormat" value="MESSAGE"/>
        <entry key="loggingFeatureEnabled" value="true"/>

This works and I get the response in UTF-8.

I would be interested if the same was possible somehow declaratively,
without writing code?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message