title: PHP CURL Soap Request Print Response
body: <p>Hello I am trying to send a Soap Request to powerpay.biz and am not getting a response, plus when i use my test url </p>
  
  <p><a href="https://gkicmerchants.com/admin/classes/soap-request.xml" rel="nofollow">https://gkicmerchants.com/admin/classes/soap-request.xml</a></p>
  
  <p>i get this error</p>
  
  <pre><code>Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 1: parser error : Start tag expected, '&lt;' not found in /home/content/g/k/i/gkic1848/html/admin/classes/submit_applicant.class.php on line 299
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>$username = 'user';
  $password = 'password';
  $credentials = $username.":".$password; 
  $url = "http://gkicmerchants.com/admin/classes/soap-server.php";
  
  $soap_request = '&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;/soap:Body&gt;
              &lt;/soap:Envelope&gt;';
  
  $header = array(
  "Content-type: text/xml;charset=\"utf-8\"",
  "Accept: text/xml",
  "Cache-Control: no-cache",
  "Pragma: no-cache",
  "SOAPAction: '".$url."'",
  "Content-length: ".strlen($soap_request),
  );
  
  
  $curl = curl_init(); 
  
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; 
  curl_setopt($curl, CURLOPT_USERPWD, $credentials); 
  curl_setopt($curl, CURLOPT_SSLVERSION,3); 
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); 
  curl_setopt($curl, CURLOPT_HEADER, true); 
  curl_setopt($curl, CURLOPT_POST, 1); 
  curl_setopt($curl, CURLOPT_POSTFIELDS, $soap_request );
  curl_setopt($curl, CURLOPT_HTTPHEADER,     $header);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); 
  curl_setopt($curl, CURLOPT_URL, $url); 
  
  // perform the request
  
  $xml_result = curl_exec($curl);
  // check for errors
  if ($xml_result === false) {
  $error_occurred = true;
  }
  else {
  
      $xml = new SimpleXMLElement($xml_result);
  
      print_r($xml);
  }
  </code></pre>
  
  <p>Is something wrong with curl_setopt options?</p>