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.
My understanding is that RPC is supposed to call my function with the data, but that doesn't seem to be happening.
This ridiculously simple script should write the XML to a log file, yet it does nothing:
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") ) );
They are sending me this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<methodCall>
<methodName>ImportOrders</methodName>
<params>
<param>
<value><int>2</int></value>
</param>
<param>
<value><struct>
<member><name>order_0</name>
<value><struct>
<member><name>order_id</name>
....
Why isn't my function being called?!?