title: How to send this authentication headers within SOAP requests?
body: <p>I'm building a PHP application that needs to connect to a webservice which requires a header in every request for authentication. How to send the following along with the requests? Do I need to use SoapHeader along with SoapClient?</p>
  
  <pre><code>&lt;soap:Header&gt;
  &lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
  wssecurity-secext-1.0.xsd"&gt;
  &lt;wsse:UsernameToken wsu:Id="Id-0001334008436683-000000002c4a1908-1"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
  &lt;wsse:Username&gt;[username]&lt;/wsse:Username&gt;
  &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-
  token-profile-1.0#PasswordText"&gt;[password]&lt;/wsse:Password&gt;
  &lt;/wsse:UsernameToken&gt;
  &lt;/wsse:Security&gt;
  &lt;/soap:Header&gt;
  </code></pre>