You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Asif Ali <as...@yahoo.com> on 2013/05/20 21:29:51 UTC

Unable to parse unicode chars in the webservice response.

Hi,

I have a web service client written in CXF with encoding as UTF-8. Whenever
the service response contains unicode values like &#8217; CXF is not parsing
that values, instead it is storing junk value in the java property. All the
other symbols and special characters are parsed successfully but when it
comes to unicode values like &#8217; when unmarshalling to java objects i am
seeing junk value in the java property. Do i need to set any extra
configuration to resolve this.

Thanks in advance.
Asif.



--
View this message in context: http://cxf.547215.n5.nabble.com/Unable-to-parse-unicode-chars-in-the-webservice-response-tp5727983.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Unable to parse unicode chars in the webservice response.

Posted by Asif Ali <as...@yahoo.com>.
Hi Daniel,

When i received the response, i checked the content-type value in the header
and it says UTF-8. For both outbound and inbound messages the content-type
is UTF-8 only.

Thanks,
Asif.



--
View this message in context: http://cxf.547215.n5.nabble.com/Unable-to-parse-unicode-chars-in-the-webservice-response-tp5727983p5727998.html
Sent from the cxf-dev mailing list archive at Nabble.com.

RE: Unable to parse unicode chars in the webservice response.

Posted by Diego Cando <dc...@jrelectric.com.ec>.
So, I'm trying to get a webservice like this (client call)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsk="http://www.sinardap.gob.ec/WSKiosco/"> 
            <soapenv:Header/> 
            <soapenv:Body> 
             <wsk:EntradaObtenerLogin>

I get a regular one with xmlns:ws=... but I cannot get one with wsk

Can that be a charset issue?

Saludos cordiales/kind regards,
Diego Cando
JR Electric Supply / Consorcio MTE Latinus

-----Mensaje original-----
De: Daniel Kulp [mailto:dkulp@apache.org] 
Enviado el: lunes, 20 de mayo de 2013 14:55
Para: dev@cxf.apache.org; Asif Ali
Asunto: Re: Unable to parse unicode chars in the webservice response.


On May 20, 2013, at 3:29 PM, Asif Ali <as...@yahoo.com> wrote:
> 
> I have a web service client written in CXF with encoding as UTF-8. 
> Whenever the service response contains unicode values like &#8217; CXF 
> is not parsing that values, instead it is storing junk value in the 
> java property. All the other symbols and special characters are parsed 
> successfully but when it comes to unicode values like &#8217; when 
> unmarshalling to java objects i am seeing junk value in the java 
> property. Do i need to set any extra configuration to resolve this.
> 

Can you use wireshark or similar to capture the raw bytes being transferred
across the wire.   The NORMAL cause for this type of problem is the client
side not setting the charset on the Content-Type HTTP header to UTF-8.    By
default, if unspecified, the charset is ISO-8859-1 which would certainly
cause this type of problem.


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


Re: Unable to parse unicode chars in the webservice response.

Posted by Daniel Kulp <dk...@apache.org>.
On May 20, 2013, at 3:29 PM, Asif Ali <as...@yahoo.com> wrote:
> 
> I have a web service client written in CXF with encoding as UTF-8. Whenever
> the service response contains unicode values like &#8217; CXF is not parsing
> that values, instead it is storing junk value in the java property. All the
> other symbols and special characters are parsed successfully but when it
> comes to unicode values like &#8217; when unmarshalling to java objects i am
> seeing junk value in the java property. Do i need to set any extra
> configuration to resolve this.
> 

Can you use wireshark or similar to capture the raw bytes being transferred across the wire.   The NORMAL cause for this type of problem is the client side not setting the charset on the Content-Type HTTP header to UTF-8.    By default, if unspecified, the charset is ISO-8859-1 which would certainly cause this type of problem.


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