You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by skousouris <st...@hotmail.com> on 2012/10/04 15:58:43 UTC
Re: Set HTTP Header on response from SOAP web service
Is it possible to explain how to modify in my client's interceptor chain the
HTTPResponse Headers?
LOGGER.debug("Header CHARACTER ENCODING=",
message.getExchange().getInMessage().get(Message.ENCODING));
LOGGER.debug("Header CONTENT TYPE=",
message.getExchange().getInMessage().get(Message.CONTENT_TYPE));
both result in an empty string
Header CHARACTER ENCODING=
Header CONTENT TYPE=
I need to access them in order to modify them but at the moment I am not
able to access them nor modify them could you provide some assistance?
The problem I am facing is that the response returns
Encoding: ISO-8859-1
Content-Type: text/xml
and since the other side returns UTF-8 in the payload (the payload does say
it is UTF-8) the CXF does not seem to be able to handle the UTF-8 characters
correctly. Therefore I am trying to change the headers to
Encoding: UTF-8
Content-Type: text/xml;charset=UTF-8
which when present (I have mocked the external webservice) result in the
correct character set seems to be used by CXF.
--
View this message in context: http://cxf.547215.n5.nabble.com/Set-HTTP-Header-on-response-from-SOAP-web-service-tp5490251p5715638.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Set HTTP Header on response from SOAP web service
Posted by skousouris <st...@hotmail.com>.
Despite not being able to read a value from them I managed to set them in the
interceptor and now the encoding works
message.put(Message.ENCODING, "UTF-8");
message.put(Message.CONTENT_TYPE, "text/xml;charset=UTF-8");
--
View this message in context: http://cxf.547215.n5.nabble.com/Set-HTTP-Header-on-response-from-SOAP-web-service-tp5490251p5715693.html
Sent from the cxf-user mailing list archive at Nabble.com.