You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Javier V <ja...@hotmail.com> on 2006/08/02 11:17:39 UTC

[Axis2] Character Encoding

Hi,

I want to change the character encoding to another than UTF-8, like
UTF-16 or ISO-8859-1.

I've tried with:

      Options options = new Options();
      options.setTo(targetEPR);

      
options.setProperty(org.apache.axis2.context.MessageContext.CHARACTER_SET_ENCODING, 
org.apache.axis2.context.MessageContext.UTF_16);

      ServiceClient sender = new ServiceClient();
      sender.setOptions(options);

      OMElement result2 = sender.sendReceive(payload2);

but does not work, with the SOAPMonitor the SOAP message begins with

  <?xml version='1.0' encoding='utf-8'?>

and the text included is utf-8 too.

I've tried with
options.setProperty(org.apache.axis2.context.MessageContext.DEFAULT_CHAR_SET_ENCODING, 
"utf-16");

and "UTF-16" but doesn't work.

Can anybody help me?

Thanks in advance

Janfry

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor 
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Character Encoding

Posted by Eran Chinthaka <ch...@opensource.lk>.
The constant should be
org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING

(Arghh, when will my article on the constants gets published :( )

This SHOULD work with latest nightly build. If not please find a bug in
JIRA.


-- Chinthaka

Javier V wrote:
> Hi,
> 
> I want to change the character encoding to another than UTF-8, like
> UTF-16 or ISO-8859-1.
> 
> I've tried with:
> 
>      Options options = new Options();
>      options.setTo(targetEPR);
> 
>     
> options.setProperty(org.apache.axis2.context.MessageContext.CHARACTER_SET_ENCODING,
> org.apache.axis2.context.MessageContext.UTF_16);
> 
>      ServiceClient sender = new ServiceClient();
>      sender.setOptions(options);
> 
>      OMElement result2 = sender.sendReceive(payload2);
> 
> but does not work, with the SOAPMonitor the SOAP message begins with
> 
>  <?xml version='1.0' encoding='utf-8'?>
> 
> and the text included is utf-8 too.
> 
> I've tried with
> options.setProperty(org.apache.axis2.context.MessageContext.DEFAULT_CHAR_SET_ENCODING,
> "utf-16");
> 
> and "UTF-16" but doesn't work.
> 
> Can anybody help me?
> 
> Thanks in advance
> 
> Janfry
> 
> _________________________________________________________________
> Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN
> Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 



Re: [Axis2] Character Encoding

Posted by Davanum Srinivas <da...@gmail.com>.
Are u using latest nightly? If so, please log a bug report.

Thanks,
dims

On 8/2/06, Javier V <ja...@hotmail.com> wrote:
> Hi,
>
> I want to change the character encoding to another than UTF-8, like
> UTF-16 or ISO-8859-1.
>
> I've tried with:
>
>       Options options = new Options();
>       options.setTo(targetEPR);
>
>
> options.setProperty(org.apache.axis2.context.MessageContext.CHARACTER_SET_ENCODING,
> org.apache.axis2.context.MessageContext.UTF_16);
>
>       ServiceClient sender = new ServiceClient();
>       sender.setOptions(options);
>
>       OMElement result2 = sender.sendReceive(payload2);
>
> but does not work, with the SOAPMonitor the SOAP message begins with
>
>   <?xml version='1.0' encoding='utf-8'?>
>
> and the text included is utf-8 too.
>
> I've tried with
> options.setProperty(org.apache.axis2.context.MessageContext.DEFAULT_CHAR_SET_ENCODING,
> "utf-16");
>
> and "UTF-16" but doesn't work.
>
> Can anybody help me?
>
> Thanks in advance
>
> Janfry
>
> _________________________________________________________________
> Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor
> & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org