[eluser]Elliot Haughin[/eluser]
Ok, this is still an issue, and quite a big one.
I have the following basic 'Api' Controller to handle XML-RPC requests:
Code:
<?php
class Api extends Controller {
function Api()
{
parent::Controller();
log_message('debug', 'Api received method');
}
function index()
{
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$this->load->library('server');
$config['functions']['Posts.getLatest'] = array('function' => 'Posts.getLatest');
$config['functions']['Posts.getSingle'] = array('function' => 'Posts.getSingle');
$config['object'] = $this;
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
}
?>
The server library just does some work with the params, like auth the request and remove the user/pass from the beginning of it.
Now, here's controllers/posts.php:
Code:
<?php
class Posts extends Controller {
function Posts()
{
parent::Controller();
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$this->load->library('server');
}
function getLatest($request)
{
$params = $this->server->prep_request($request);
if (!empty($params[0]))
{
$limit = $params[0];
}
else
{
$limit = 'none';
}
$response = array('you want posts! limit '.$limit, 'string');
return $this->server->send_response($response);
}
}
?>
Just to me on the safe side i've loaded the constructor in there too.
However, when calling Posts.getLatest from a client, I get this error:
Quote:This is not a known method for this XML-RPC Server
Try it out, it's broken! I think this is a pretty critical error, could someone confirm this ASAP?