title: Receiving XML with file_get_contents()
body: <p>I am new to this site and also new to web services.  I am trying to create a web service that sends an xml response back to a client request.  The problem I am having is when I execute the client request, the browser hangs and eventually comes back with a server time out error.  I have checked the PHP.INI settings to make sure allow_url_fopen is set to on.
  I am hosting the website on an IBM i using Zend Server.
  Thanks in advance for your help.</p>
  
  <p>This is how I am trying to do it:</p>
  
  <p>Server side:  This file is called XML3.php</p>
  
  <pre><code>&lt;?php
  ob_start();
  header("Content-Type:text/xml");
  echo "&lt;?xml version='1.0' encoding='UTF-8' ?&gt;";
  echo '&lt;posts&gt;';
      echo '&lt;post&gt;';
      echo "&lt;title&gt;title1&lt;/title&gt;";
      echo "&lt;body&gt;this is the body&lt;/body&gt;";
      echo "&lt;post_date&gt;02/10/2012&lt;/post_date&gt;";
      echo '&lt;/post&gt;';
  echo '&lt;/posts&gt;';
  ob_end_flush();
  
  ?&gt;
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>&lt;?php 
  $xml = file_get_contents('http://corvetteamericadealers.com/dev1/Examples/XML3.php');
  $sxe = new SimpleXMLElement($xml);
  var_dump($sxe); 
  </code></pre>