title: Cannot modify http accept header in SOAP WebService client - JAX-WS 2.2.10 - JDK1.7
body: <p>I migrated a webservice client from jdk1.6 jax-ws (v1 ? An old one - 2005) to jdk1.7 jax-ws 2.2.10. 
  The old one was functional, but I have a problem with the new one :
  The service (from another society, php server) responds to me : http 406 error, not acceptable.</p>
  
  <p>The accept header I send is :</p>
  
  <pre><code>Accept: text/xml, multipart/related
  Content-Type: text/xml; charset=utf-8
  </code></pre>
  
  <p>With the old version, I had :</p>
  
  <pre><code>Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  Content-type: text/xml;charset="utf-8"
  </code></pre>
  
  <p>So I tried to modify the http header like this (inside a new handler in my binding handler chain): </p>
  
  <p>In my client :</p>
  
  <pre><code>    javax.xml.ws.Binding binding = ((BindingProvider) ServiceXXX).getBinding();
      List&lt;Handler&gt; hchain = binding.getHandlerChain();
      if (hchain == null) {hchain = new ArrayList&lt;Handler&gt;();}
      hchain.add(new HTTPUserAgentHandler());
      binding.setHandlerChain(hchain);
  </code></pre>
  
  <p>In my new handler :</p>
  
  <pre><code>Map&lt;String, List&lt;String&gt;&gt; headers = (Map&lt;String, List&lt;String&gt;&gt;) context.get(MessageContext.HTTP_REQUEST_HEADERS);
  if (null == headers) {headers = new HashMap&lt;String, List&lt;String&gt;&gt;();}
  headers.put("Accept", Arrays.asList("text/xml", "multipart/related", "*/*"));
  context.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
  </code></pre>
  
  <p>My http header is now correct but in HttpTransportPipe class, it's overwritten :</p>
  
  <pre><code>        reqHeaders.put("Content-Type", Collections.singletonList(ct.getContentType()));
          if (ct.getAcceptHeader() != null) {
              reqHeaders.put("Accept", Collections.singletonList(ct.getAcceptHeader()));
          }
          if (binding instanceof SOAPBinding) {
              writeSOAPAction(reqHeaders, ct.getSOAPActionHeader());
          }
  </code></pre>
  
  <p>The server, apparently 1.1, needs I send an accept with <code>"*/*"</code>
  Any Idea of how I can do this ?</p>