Hi

The problem which affects Logging interceptors is that default HTTP 1.1 encoding is ISO-8859-1 but the actual HTTP Encoding header and this default value is very old. CXF server sets Encoding and it is not needed - if the consumer needs a default value then it does not need Encoding header to get the default charset value.

FYI, JAX-RS readers/writers assume UTF-8 if no media type charset is used (in Content-Type). Pretty sure Jersey/RestEasy do it too.

Logging interceptors apparently check Encoding header.

I wonder what JAXWS defaults too and I'm not sure CXF JAXWS needs 'Encoding' header.

At least on the JAXRS path we can def remove Encoding header.
And defaulting to UTF-8 makes sense IMHO, with so many languages around.

Sergey
On 17/08/16 09:31, Christian Schneider wrote:
I think it will assume the system default charset as default.

So you could try to change that. See
https://javarevisited.blogspot.de/2012/01/get-set-default-character-encoding.html


Chistian


On 17.08.2016 10:19, Vjacheslav V. Borisov wrote:
2016-08-17 11:19 GMT+04:00 Christian Schneider <[email protected]>:

You should also take a look at the new Logging support in:
https://github.com/apache/cxf/tree/master/rt/features/logging

http://www.liquid-reality.de/display/liquid/2015/06/08/Enter
prise+ready+request+logging+with+CXF+3.1.0+and+elastic+search

The new logging feature should also make it easier to customize the
way to
output the message.


Thanks Christian
Tried, but with same result
don't know why, but this string  String encoding =
(String)message.get(Message.ENCODING)
returns ISO-8859-1 when client sends request without charset
e.g. when cleint sends request with Content-Type:
application/json;charset=UTF-8
it is logged correctly by both loggers, new and old
and when there is no charset in request, it assumes ISO-8859-1 by default





--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to