title: How do I specify the WS-Addressing version with a JAX-WS client?
body: <p>I generated a SOAP 1.2 web service client with wsimport (JDK 1.7). I need it to explicitly use WS-Addressing 2004/08 and not 2005/08.
  The closest I could find for instanciating the client was</p>
  
  <pre><code>import MyService.*;
  import javax.xml.ws.BindingProvider;
  
  public class test {
  
      public static void main(String[] args) {
          MyService service = new MyService();  
          IMyService proxy = service.getMyService(new javax.xml.ws.soap.AddressingFeature(true, true) );  
          ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://192.168.0.5:1234/services/MyService");
          proxy.Ping("Foo");
        }
  }
  </code></pre>
  
  <p>The important bit being</p>
  
  <pre><code>MyService service = new MyService();
  IMyService proxy = service.getMyService(new javax.xml.ws.soap.AddressingFeature(true, true));
  </code></pre>
  
  <p>Unfortunately, this results in 2005/08 addressing.  Not supplying an argument to getMyService() results in not using WS-Addressing.</p>
  
  <p>The only examples I can find on Google that force 2004/08 Addressing use Axis2 (the whole reason I want JAX-WS is to move away from Axis2)</p>
  
  <p>The difference on the wire is
  (2004/08)</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;
      &lt;s:Header&gt;
          &lt;a:Action s:mustUnderstand="1"&gt;http://www.example.com/schemas/service/myservice/IMyService/Ping&lt;/a:Action&gt;
          &lt;a:MessageID&gt;urn:uuid:87727401-b1a0-4667-9ef0-c64e58800ff6&lt;/a:MessageID&gt;
          &lt;a:ReplyTo&gt;
              &lt;a:Address&gt;http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous&lt;/a:Address&gt;
          &lt;/a:ReplyTo&gt;
          &lt;a:To s:mustUnderstand="1"&gt;https://192.168.0.5:1234/services/MyService&lt;/a:To&gt;
      &lt;/s:Header&gt;
      &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
          &lt;Ping xmlns="http://www.example.com/schemas/service/myservice"&gt;
              &lt;Message&gt;Foo&lt;/Message&gt;
          &lt;/Ping&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>(2005/08)</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"&gt;
      &lt;S:Header&gt;
          &lt;To xmlns="http://www.w3.org/2005/08/addressing"&gt;https://192.168.0.5:1234/services/MyService&lt;/To&gt;
          &lt;Action xmlns="http://www.w3.org/2005/08/addressing" xmlns:S="http://www.w3.org/2003/05/soap-envelope" S:mustUnderstand="true"&gt;http://www.example.com/schemas/service/myservice/IMyService/Ping&lt;/Action&gt;
          &lt;ReplyTo xmlns="http://www.w3.org/2005/08/addressing"&gt;
              &lt;Address&gt;http://www.w3.org/2005/08/addressing/anonymous&lt;/Address&gt;
          &lt;/ReplyTo&gt;
          &lt;MessageID xmlns="http://www.w3.org/2005/08/addressing"&gt;uuid:87727401-b1a0-4667-9ef0-c64e58800ff6&lt;/MessageID&gt;
      &lt;/S:Header&gt;
      &lt;S:Body&gt;
          &lt;Ping xmlns="http://www.example.com/schemas/service/myservice"&gt;
              &lt;Message&gt;Foo&lt;/Message&gt;
          &lt;/Ping&gt;
      &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>Anyone have any ideas here?</p>