On Mon March 1 2010 6:21:19 am Valerio Angelini wrote:
> Dear all,
>
> do anyone know how could be possible to control the encoding of the XML
> response for a jax-ws service?
>
> In particular I need these :
> - The response is now created without the XML prolog. How can I force its
> creation?
> - The response http header declares a content-encoding like
> "text/xml; charset=ISO-8859-1", but I would like to specify a "UTF-8"
> charset.
>
> I'm currently using cxf-2.2.4 and jax-ws with the @WebServiceProvider()
> interface.
Within your implementation, you should be able to do something like:
Message m = PhaseInterceptorChain.getCurrentMessage();
m.put(Message.ENCODING, "UTF-8");
m.getExchange().put("org.apache.cxf.stax.force-start-document", Boolean.TRUE);
That should handle both situations.
Dan
>
> Thanks a lot in advance
>
> Valerio
>
> --
> Valerio Angelini
> Institute of Methodologies for Environmental Analysis
> Italian National Research Council
> phone: +39 0574 602535
> e-mail: [email protected]
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog