You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2015/02/03 21:34:59 UTC

Re: Response was of unexpected text/html ContentType?

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.

Dan



> On Jan 29, 2015, at 4:24 PM, membersound2 <ko...@gmail.com> 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="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">[...]
> 
> 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: http://cxf.547215.n5.nabble.com/Response-was-of-unexpected-text-html-ContentType-tp5753723.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Response was of unexpected text/html ContentType?

Posted by membersound2 <ko...@gmail.com>.
Thanks Daniel, it turned out that indeed it was a server problem. You were
absolutely right!



--
View this message in context: http://cxf.547215.n5.nabble.com/Response-was-of-unexpected-text-html-ContentType-tp5753723p5753903.html
Sent from the cxf-user mailing list archive at Nabble.com.