title: Add header elements to SOAP message
body: <p>I'm trying to find a way to add header elements to a SOAP message. 
  If I use <code>@WebParam</code> with <code>header</code> set to <code>true</code> then it works fine, that parameter is nicely in <code>&lt;soap:header&gt;</code>. However, the requires adding a bunch of parameters to my API which is hardly an option.</p>
  
  <p>At first view interceptors do not appear to be possible so I was looking at SOAPHandlers but it is so difficult to find clear information about this. </p>
  
  <p>This is my spring config:</p>
  
  <pre><code>&lt;bean id="testWebservice" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean" &gt;
      &lt;property name="serviceInterface" value="com...TestWebService"/&gt;
      &lt;property name="wsdlDocumentUrl" value="http://localhost:9062/test-ws/remoting/test?wsdl"/&gt;
      &lt;property name="serviceName" value="TestWebService"/&gt;
      &lt;property name="namespaceUri" value="http://test.com"/&gt;
      &lt;property name="portName" value="TestServicePort"/&gt;
      &lt;property name="lookupServiceOnStartup" value="false"/&gt;
      &lt;property name="handlerResolver" ref="myResolver"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="myResolver" class="com...TestHandlerResolver" /&gt;
  </code></pre>
  
  <p>My Handler (chained in the TestHandlerResolver):</p>
  
  <pre><code>public class TestHandler implements SOAPHandler&lt;SOAPMessageContext&gt; {
  
      @Override
      public void close(MessageContext context) {
      }
  
      @Override
      public Set&lt;QName&gt; getHeaders() {
          return null;
      }
  
      @Override
      public boolean handleFault(SOAPMessageContext context) {
          return true;
      }
  
      @Override
      public boolean handleMessage(SOAPMessageContext context) {
          if (Boolean.TRUE.equals(context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
  
              try {
                  List&lt;Header&gt; headers = new ArrayList&lt;Header&gt;();
                  Header dummyHeader;
                  dummyHeader = new Header(new QName("dummy"), "decapitated", new JAXBDataBinding(String.class));
                  headers.add(dummyHeader);
                  context.put(Header.HEADER_LIST, headers);
              } catch (Exception e) {
                  throw new RuntimeException(e);
              }
          }
          return true;
      }
  }
  </code></pre>
  
  <p>The problem is that I'm a bit at a loss. Is using handler the right way to do this and if so can you give or point me to a nice example? Is there a way to do it with interceptors? Or am I completely of the target here...</p>