I dug a little deeper. I activated cxf component's loggingFeatureEnabled
property. Seems that the response from the WS is encoded with ISO-8859-1:

request:

014-01-01 16:10:01,055 | INFO  | ler-ura_Worker-1 | UraPort                     
    
| 132 - org.apache.cxf.cxf-api - 2.6.8 | Outbound Message
---------------------------
ID: 1
Address: http://localhost:8080/integraatiot-ws-1.0-SNAPSHOT/UraImpl
Content-Type: text/xml
Headers: {Accept=[*/*],
breadcrumbId=[ID-vagrant-lubuntu-quantic-42829-1388585068316-7-3],
fireTime=[Wed Jan 01 16:10:00 EET 2014], jobDetail=[JobDetail
'DEFAULT.quartz-endpoint82':  jobClass:
'org.apache.camel.component.quartz.CamelJob isStateful: false isVolatile:
false isDurable: false requestsRecovers: false],
jobInstance=[org.apache.camel.component.quartz.CamelJob@3d722847],
jobRunTime=[-1], mergedJobDataMap=[org.quartz.JobDataMap@509f17b6],
nextFireTime=[Wed Jan 01 16:11:00 EET 2014], refireCount=[0],
scheduledFireTime=[Wed Jan 01 16:10:00 EET 2014],
scheduler=[org.quartz.impl.StdScheduler@236312f7], trigger=[Trigger
'Camel.uraDelegoinnitJob':  triggerClass: 'org.quartz.CronTrigger
isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Wed
Jan 01 16:11:00 EET 2014], triggerGroup=[Camel],
triggerName=[uraDelegoinnitJob]}
Payload: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns3="http://eura2014.fi/ura/xsd/1.0";>
    <ns2:Body>
        <ns3:foostuff...>...
        </ns3:foostuff>
    </ns2:Body>
</ns2:Envelope>

response:

2014-01-01 16:15:01,019 | INFO  | ault-workqueue-1 | UraPort                    
     
| 132 - org.apache.cxf.cxf-api - 2.6.8 | Inbound Message
----------------------------
ID: 6
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: text/xml;charset=ISO-8859-1
Headers: {Content-Length=[2306], content-type=[text/xml;charset=ISO-8859-1],
Date=[Wed, 01 Jan 2014 14:15:01 GMT], Server=[Apache-Coyote/1.1]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body>somfoostuff....<HankkeenKuvaus>kuvaus
jossa viimeinen merkki on skandiÄ</HankkeenKuvaus>

When I test the same WS with SoapUI, I get the response in UTF-8. 

Date    Wed, 01 Jan 2014 12:47:22 GMT
Content-Length  2306
#status#        HTTP/1.1 200 OK
Content-Type    application/soap+xml;charset=UTF-8
Server  Apache-Coyote/1.1

SoapUI seems to have preferences for "request properties / encoding" and
this results in http header
"Content-Type:application/soap+xml;charset=UTF-8". And this changes the
actual WS to return UTF-8 instead of ISO-8859-1.

Can I configure camel / cxf component to request for UTF-8 encoding as well?
I could not find a quick param for that at
http://camel.apache.org/cxf.html#CXF-Thedescriptionsofthedataformats





--
View this message in context: 
http://camel.465427.n5.nabble.com/Trying-to-consume-SOAP-WS-with-UTF-8-content-getting-Invalid-UTF-8-middle-byte-0x3c-tp5745394p5745396.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to