title: SOAP for a newbie using PHP
body: <p>There is a SOAP web service I need to connect to but I am having a hard time wrapping my head around how SOAP works. I just recently learned the basics of using REST, which was pretty easy, and I am also taking my first steps in programming (PHP).</p>
  
  <p>According to the documentation the first thing I need to do is write this header.</p>
  
  <pre><code>&lt;soap:Header&gt;
  
  &lt;wsse:Security soap:mustUnderstand="1"&gt;
  
  &lt;wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-24ada6f8-4626-4269-b786-a22361bfde78"&gt;
  
  &lt;wsse:Username&gt;ws.test&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;test&lt;/wsse:Password&gt;
  
  &lt;/wsse:UsernameToken&gt;
  
  &lt;/wsse:Security&gt;
  
  &lt;/soap:Header&gt;
  </code></pre>
  
  <p>I tried to search for a way to do this with php and I might be able to do something similar but I don't understand what I am doing though.</p>
  
  <p>The documentation tells me to use WSE 2.0, but I read online that WSE is obsolete. Should I then not use that? And to be honest, I don't even know what WSE is. Is that something I should be downloading or is that something that is on the server?</p>
  
  <p>If anyone can shed any light on this or suggest simple up to date instructions for a SOAP beginner, I'd be very grateful.</p>