title: access SOAPHeader in java webservice code (not via a handler)
body: <p>I need to access the SOAPHeader in my webservice code (i need it to generate some objects from the security-part of the header using an external library).</p>
  
  <p>It works fine in a SOAPHandler, but if i try the following in the actual webservice method i get an exception.</p>
  
  <pre><code>SOAPMessageContext soapMsgContext = (SOAPMessageContext) webServiceContext.getMessageContext();
  SOAPHeader soapHeader =  soapMsgContext.getMessage().getSOAPHeader();
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>JAXBBlockImpl block object is already consumed. Processing cannot continue.
  </code></pre>
  
  <p>I would like to do one of the following:</p>
  
  <ol>
  <li>Process the header in the handler and get the resulting object to the webservice method. </li>
  <li>Process the header in the webservice method.</li>
  </ol>
  
  <p>Can anyone tell me how to do either one of these steps?</p>
  
  <p>Thanks in advance.</p>