[ 
https://issues.apache.org/jira/browse/CXF-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved CXF-3228.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.2

> SOAPMessage does not recognize SOAPMessage.WRITE_XML_DECLARATION
> ----------------------------------------------------------------
>
>                 Key: CXF-3228
>                 URL: https://issues.apache.org/jira/browse/CXF-3228
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: David Liu
>            Assignee: Daniel Kulp
>             Fix For: 2.3.2
>
>
> Hi,
>   It could be a bug in cxf's  @WebServiceProvider implementation that we 
> cannot control the output xml encoding by setting 
> SOAPMessage.CHARACTER_SET_ENCODING. The encoding ( {quote}<?xml version="1.0" 
> encoding="UTF-8"?>{quote}  ) response message was not changed when I change 
> CHARACTER_SET_ENCODING to UTF-16. 
> Please see my test class:
> {quote}
> @WebServiceProvider
> @ServiceMode(value = Service.Mode.MESSAGE)
> public class CalculatorProvider implements Provider<SOAPMessage> {
>     @Override
>     public SOAPMessage invoke(SOAPMessage request) {
>         long start = System.currentTimeMillis();
>         System.out.println("********* start at " + start);
>         try {
>             MessageFactory mf = MessageFactory.newInstance();
>             SOAPMessage soapMsg = mf.createMessage();
>             soapMsg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-16");
>             soapMsg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "false");
>             soapMsg.getSOAPBody().addBodyElement(new QName("mytest"));
>             soapMsg.saveChanges();
>             return soapMsg;
>         } catch (SOAPException e) {
>             throw new RuntimeException(e);
>         }
>     }
>     public static void main(String[] args) {
>         System.out.println("Starting Server");
>         CalculatorProvider implementor = new CalculatorProvider();
>         String address = "http://localhost:7650/Calculator";;
>         Endpoint.publish(address, implementor);
>     }
> }
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to