cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: Response was of unexpected text/html ContentType?
Date Tue, 03 Feb 2015 20:34:59 GMT
If the server is responding with text/html but putting XML in the body, that’s definitely
a server side problem and you should report it to them.

To work around it, you would likely need to add an interceptor on the CXF client  that would
reset the Message.CONTENT_TYPE property to text/xml or similar so CXF would recognize it as
XML.   If the content type isn’t an XML type, CXF won’t look at the body at all.


> On Jan 29, 2015, at 4:24 PM, membersound2 <> wrote:
> Does CXF support "text/html" streams?
> My problem is: I have a running soap webservice client, and the server not
> responds with contentType=text/html all of a sudden.
> It used to be application/xml, but as it is an external API, there's not
> much I can change about it (or can enforce the returned content type)?
> Anyhow, how can I parse this stream with CXF?
> The error message is as follows:
> Caused by: org.apache.cxf.interceptor.Fault: Response was of unexpected
> text/html ContentType.  Incoming portion of HTML stream: <?xml version="1.0"
> encoding="UTF-8"?>
> <SOAP:Envelope
> xmlns:SOAP=""><soapenv:Header
> xmlns:soapenv="">[...]
> Maybe the error is due to the <?xml starting tag? Or is it because after the
> xml tag there is a linebreak, but the rest of the soap response is a
> oneliner (the 2nd line)?
> Hope you could help.
> Thanks
> --
> View this message in context:
> Sent from the cxf-user mailing list archive at

Daniel Kulp -
Talend Community Coder -

View raw message