title: Howto setup JAX-WS client to use ISO-8859-1 instead of UTF-8?
body: <p>I would like to configure my JAX-WS client to send messages in <strong>ISO-8859-1</strong>. Currently <strong>UTF-8</strong> is used.</p>
  
  <p>Here is what the client tries to do:</p>
  
  <pre class="lang-java prettyprint-override"><code>Map&lt;String, Object&gt; reqContext = ((BindingProvider) service).getRequestContext();
  Map httpHeaders = new HashMap();
  httpHeaders.put("Content-type",Collections.singletonList("text/xml;charset=ISO-8859-1"));
  reqContext.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
  </code></pre>
  
  <p>But this setting is ignored and tcpmon shows that the following is received by the server:</p>
  
  <pre class="lang-none prettyprint-override"><code>POST /service/helloWorld?WSDL HTTP/1.1
  Content-type: text/xml;charset="utf-8"
  Soapaction: "helloWorld"
  Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  User-Agent: Oracle JAX-WS 2.1.5
  Host: 1.1.1.1:8001
  Connection: keep-alive
  Content-Length: 4135
  
  &lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;S:Envelopexmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;...  
  </code></pre>
  
  <p>So, the setting is overriden and UTF-8 is used, both in the HTTP header and in the XML message. The service is defined by the WSDL which is encoded in UTF-8.</p>
  
  <p><strong>Q:</strong> Should I redefine the service WSDL to be encoded in ISO-8899-1 and then regenerate the client? Or, is it that I am just not setting the HTTP headers properly?</p>