title: How do I access XML-RPC data from PHP?
body: <p>A remote server is POSTing XML to my server via RPC. I can see the XML in my Apache logs when I turn on mod security, but I can't access the XML from my PHP script. It's supposed to be a POST request, but the $_POST array is empty.</p>
  
  <p>My understanding is that RPC is supposed to call my function with the data, but that doesn't seem to be happening.</p>
  
  <p>This ridiculously simple script should write the XML to a log file, yet it does nothing:</p>
  
  <pre>
  include_once('xmlrpc/xmlrpc.inc');
  include_once('xmlrpc/xmlrpcs.inc');
  
  function ImportOrders($xml)
  {
     $FH=fopen('Log/In.txt','a');
     fwrite($FH,'Package recieved:'.print_r($xml,true)."\n");
  
     // set appropriate response code
     $response = 0; // see defined response codes for this application
     // send success or failure response code
     if($response == 0)
        return new xmlrpcresp(new xmlrpcval($response, "string"));
     else
        return new xmlrpcresp(0, $response, $error_message);
  }
  
  $Server = new xmlrpc_server(
     array("ImportOrders"=>array("function"=>"ImportOrders")
     )
  );
  </pre>
  
  <p>They are sending me this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;methodCall&gt;
  &lt;methodName&gt;ImportOrders&lt;/methodName&gt;
  &lt;params&gt;
  &lt;param&gt;
  &lt;value&gt;&lt;int&gt;2&lt;/int&gt;&lt;/value&gt;
  &lt;/param&gt;
  &lt;param&gt;
  &lt;value&gt;&lt;struct&gt;
  &lt;member&gt;&lt;name&gt;order_0&lt;/name&gt;
  &lt;value&gt;&lt;struct&gt;
  &lt;member&gt;&lt;name&gt;order_id&lt;/name&gt;
  ....
  </code></pre>
  
  <p>Why isn't my function being called?!?</p>