[eluser]comex[/eluser]
Hello,
I'm playing around with XML-RPC and I keep getting "Internal Server Error".
Server code
Code:
class Xmlrpc extends Controller {
function index(){
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$this->xmlrpc->set_debug(TRUE);
$config['functions']['Update'] = array('function' => 'Xmlrpc._update');
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
function _update($request){
$this->_respond();
return;
}
function _respond(){
$response = array(
array(
'flerror' => array(FALSE, 'boolean'),
'message' => "Thanks for the ping!"),
'struct');
return $this->xmlrpc->send_response($response);
}
}
The reason as to why its so convoluted with _update() calling _respond() is that I took away code for clarity. The _respond() is something I found somewhere and its supposed to be working.
Client code(Python)
Code:
import xmlrpclib
#Connect to server
server_url = 'http://127.0.0.1/index.php/rpc/xmlrpc';
server = xmlrpclib.Server(server_url);
#Send request
response = server.Update(1)
print response
The client manages to connect and so on, but raises an exception alerting of the internal server error.
Now, I've read somewhere that people using the Wordpress XML-RPC had to force PHP5 on their servers. Does that seem reasonable? Or is my code flawed? =)
Thank you.