title: Webservice template : How to pass headers in webservice template
body: <p>I'm using following SOAP request at enterprise level</p>
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
     &lt;soapenv:Header&gt;
        ....
    &lt;/soapenv:Header&gt;
     &lt;soapenv:Body&gt;
  &lt;UserRQ xmlns=&quot;http://www.user.org/USER/INFO&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    ...
  </code></pre>
  
  <p>For hitting the API using postman(or so), I'm using WebServiceClient and currently passing whole request(including Headers and Body) into it</p>
  <p><strong>ApplicationClient.java</strong> :</p>
  <pre><code>    public class ApplicationClient extends WebServiceGatewaySupport  {
         
          //Envelope is the whole request
          public ResponseEntity&lt;String&gt; getResults(Envelope envelope) {
              WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
              Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
              marshaller.setContextPath(&quot;org.test.wsdl&quot;);
              webServiceTemplate.setMarshaller(marshaller);
              webServiceTemplate.setUnmarshaller(marshaller);
            
              ResponseEntity&lt;String&gt; response = (ResponseEntity&lt;String&gt;) webServiceTemplate.marshalSendAndReceive(&quot;&lt;URL&gt;&quot;, envelope);
              log.info(response.getStatusCode());
              return response;
          }
      }
      
  </code></pre>
  <p>The response is coming as correct(getting 200 responsecode). Is there anyway to pass headers and body separately through webservice client? Or How can we marshall the headers?</p>