title: How to add SOAP headers to a SOAP request using JAX-WS?
body: <p>We need to consume webservices developed by other team. Using <code>JAX-WS</code> for generating the webservices. We are using <em>wsimport</em> to generate the client side stubs. </p>
  
  <p>The problem is that i need to pass the following info as a header along with the SOAP body:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;soapenv:Header&gt;
      &lt;ns1:HeaderData xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
                      xmlns:ns1="http://www.example.com/esb/data_type/HeaderData/v1"&gt;
          &lt;ChannelIdentifier&gt;ABC&lt;/ChannelIdentifier&gt;
      &lt;/ns1:HeaderData&gt;
  &lt;/soapenv:Header&gt;
  </code></pre>
  
  <p><br>
  We are using:
  </p>
  
  <pre><code>BindingProvider.getRequestContext().put(
      BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
      serviceConfig.getServiceEndPoint()
  );
  </code></pre>
  
  <p>to set the endpoint.</p>
  
  <p>Can anyone suggest how to pass headers with request?</p>
  
  <p>Thanks,
  VK</p>