You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Sky-Tiger <da...@gmail.com> on 2009/06/08 10:35:51 UTC

Soap message encoding

Hi all,
     In most scenarios, soap/xml message is encoding with UTF-8.
     But if i want to use another encoding ,such as UTF-16, GBK...
     What i do with CXF?


Regards

Hubert.
-- 
View this message in context: http://www.nabble.com/Soap-message-encoding-tp23920250p23920250.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Soap message encoding

Posted by Daniel Kulp <dk...@apache.org>.
On Mon June 15 2009 3:05:56 am anoopPrasad wrote:
> Dear Dan,
>              So how do you suggest we handle the scenario where SOAP
> message consists of Chinese/German characters ? 

This already works.   Just make sure the HTTP Content-Type header has the 
correct charset set in it.   Basically, if the charset ISN'T set, CXF was 
assuming UTF-8 instead of ISO-8859-1.  This is now fixed.   If the charset IS 
set, then nothing changes.   

It definitely wouldn't have affected Chinese usage since none of the Chinese 
characters would have been in ISO-8859-1.   You would have HAD to have set a 
charset for those.

Dan


> Can we expect this to be
> fixed in next release of CXF? Or is there a quick fix for this at the
> server side? Please advice.
>
>
> anoopPrasad
>
> dkulp wrote:
> > Hmm....   I think this is a bug in CXF.   The CXF HttpHeaderHelper is
> > defaulting to UTF-8 if the charset is not specified.   That's wrong.  It
> > should be defaulting to ISO-8859-1.
> >
> > Dan
> >
> > On Tue June 9 2009 4:06:43 am anoopPrasad wrote:
> >> Dear Dan,
> >>
> >> 1)Do you mean that if client request has the Encoding information in the
> >> specified attribute then server
> >> side does not have to explicitly perform any additional operation to
> >> handle
> >> this?
> >> 2) there is an open defect on CXF about encoding here
> >> http://www.mulesource.org/jira/browse/MULE-4011
> >> Will this affect the said functionality?
> >>
> >> Kindly let me know your opinion on the above mentioned aspects.
> >>
> >> regards
> >> anoopPrasad
> >>
> >> dkulp wrote:
> >> > I THINK if you set the Message.ENCODING attribute on the message (for
> >> > instance, in the RequestContext) to a string denoting the encoding you
> >> > want,
> >> > it should be used.   I haven't tested that though.
> >> >
> >> > On the server side, it should respond in whatever encoding the client
> >> > sent it
> >> > in.
> >> >
> >> > Dan
> >> >
> >> > On Mon June 8 2009 4:35:51 am Sky-Tiger wrote:
> >> >> Hi all,
> >> >>      In most scenarios, soap/xml message is encoding with UTF-8.
> >> >>      But if i want to use another encoding ,such as UTF-16, GBK...
> >> >>      What i do with CXF?
> >> >>
> >> >>
> >> >> Regards
> >> >>
> >> >> Hubert.
> >> >
> >> > --
> >> > Daniel Kulp
> >> > dkulp@apache.org
> >> > http://www.dankulp.com/blog
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Soap message encoding

Posted by anoopPrasad <an...@huawei.com>.
Dear Dan,
             So how do you suggest we handle the scenario where SOAP message
consists of Chinese/German characters ? Can we expect this to be fixed in
next release of CXF? Or is there a quick fix for this at the server side?
Please advice.


anoopPrasad



dkulp wrote:
> 
> 
> Hmm....   I think this is a bug in CXF.   The CXF HttpHeaderHelper is 
> defaulting to UTF-8 if the charset is not specified.   That's wrong.  It 
> should be defaulting to ISO-8859-1.   
> 
> Dan
> 
> 
> On Tue June 9 2009 4:06:43 am anoopPrasad wrote:
>> Dear Dan,
>>
>> 1)Do you mean that if client request has the Encoding information in the
>> specified attribute then server
>> side does not have to explicitly perform any additional operation to
>> handle
>> this?
>> 2) there is an open defect on CXF about encoding here
>> http://www.mulesource.org/jira/browse/MULE-4011
>> Will this affect the said functionality?
>>
>> Kindly let me know your opinion on the above mentioned aspects.
>>
>> regards
>> anoopPrasad
>>
>> dkulp wrote:
>> > I THINK if you set the Message.ENCODING attribute on the message (for
>> > instance, in the RequestContext) to a string denoting the encoding you
>> > want,
>> > it should be used.   I haven't tested that though.
>> >
>> > On the server side, it should respond in whatever encoding the client
>> > sent it
>> > in.
>> >
>> > Dan
>> >
>> > On Mon June 8 2009 4:35:51 am Sky-Tiger wrote:
>> >> Hi all,
>> >>      In most scenarios, soap/xml message is encoding with UTF-8.
>> >>      But if i want to use another encoding ,such as UTF-16, GBK...
>> >>      What i do with CXF?
>> >>
>> >>
>> >> Regards
>> >>
>> >> Hubert.
>> >
>> > --
>> > Daniel Kulp
>> > dkulp@apache.org
>> > http://www.dankulp.com/blog
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Soap-message-encoding-tp23920250p24029670.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Soap message encoding

Posted by Daniel Kulp <dk...@apache.org>.
Hmm....   I think this is a bug in CXF.   The CXF HttpHeaderHelper is 
defaulting to UTF-8 if the charset is not specified.   That's wrong.  It 
should be defaulting to ISO-8859-1.   

Dan


On Tue June 9 2009 4:06:43 am anoopPrasad wrote:
> Dear Dan,
>
> 1)Do you mean that if client request has the Encoding information in the
> specified attribute then server
> side does not have to explicitly perform any additional operation to handle
> this?
> 2) there is an open defect on CXF about encoding here
> http://www.mulesource.org/jira/browse/MULE-4011
> Will this affect the said functionality?
>
> Kindly let me know your opinion on the above mentioned aspects.
>
> regards
> anoopPrasad
>
> dkulp wrote:
> > I THINK if you set the Message.ENCODING attribute on the message (for
> > instance, in the RequestContext) to a string denoting the encoding you
> > want,
> > it should be used.   I haven't tested that though.
> >
> > On the server side, it should respond in whatever encoding the client
> > sent it
> > in.
> >
> > Dan
> >
> > On Mon June 8 2009 4:35:51 am Sky-Tiger wrote:
> >> Hi all,
> >>      In most scenarios, soap/xml message is encoding with UTF-8.
> >>      But if i want to use another encoding ,such as UTF-16, GBK...
> >>      What i do with CXF?
> >>
> >>
> >> Regards
> >>
> >> Hubert.
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Soap message encoding

Posted by anoopPrasad <an...@huawei.com>.
Dear Dan,

1)Do you mean that if client request has the Encoding information in the
specified attribute then server
side does not have to explicitly perform any additional operation to handle
this?
2) there is an open defect on CXF about encoding here 
http://www.mulesource.org/jira/browse/MULE-4011
Will this affect the said functionality?

Kindly let me know your opinion on the above mentioned aspects.

regards
anoopPrasad


dkulp wrote:
> 
> 
> I THINK if you set the Message.ENCODING attribute on the message (for 
> instance, in the RequestContext) to a string denoting the encoding you
> want, 
> it should be used.   I haven't tested that though.
> 
> On the server side, it should respond in whatever encoding the client sent
> it 
> in.  
> 
> Dan
> 
> 
> On Mon June 8 2009 4:35:51 am Sky-Tiger wrote:
>> Hi all,
>>      In most scenarios, soap/xml message is encoding with UTF-8.
>>      But if i want to use another encoding ,such as UTF-16, GBK...
>>      What i do with CXF?
>>
>>
>> Regards
>>
>> Hubert.
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Soap-message-encoding-tp23920250p23938261.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Soap message encoding

Posted by Daniel Kulp <dk...@apache.org>.
I THINK if you set the Message.ENCODING attribute on the message (for 
instance, in the RequestContext) to a string denoting the encoding you want, 
it should be used.   I haven't tested that though.

On the server side, it should respond in whatever encoding the client sent it 
in.  

Dan


On Mon June 8 2009 4:35:51 am Sky-Tiger wrote:
> Hi all,
>      In most scenarios, soap/xml message is encoding with UTF-8.
>      But if i want to use another encoding ,such as UTF-16, GBK...
>      What i do with CXF?
>
>
> Regards
>
> Hubert.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog