title: PHP soap xml request
body: <p>I have tried to looking around the web and searching a lot but I can't figure out how to do this.</p>
  
  <p>I want to make a SOAP request with a header and XML code.</p>
  
  <p>This is how far I have come: created a variable that holds the header info:</p>
  
  <pre><code>$headers = array(
          "POST /somefile.asmx HTTP/1.1",
          "Host: a ip adress",
          "Content-Type: application/soap+xml; charset=utf-8",
          "Content-Length: ".strlen($xml_post_string)
      );
  </code></pre>
  
  <p>and the xml I want to send looking like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;GetViVaDataT xmlns="http://www.somesite.se/somefile.wsdl"&gt;
        &lt;PlatsId&gt;int&lt;/PlatsId&gt;
      &lt;/GetViVaDataT&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>But I have no idea how to go further. i'm using soap 1.2.</p>