[eluser]a77icu5[/eluser]
Code:
<?php
class Server extends Controller {
public function __construct() {
parent::Controller();
$this->load->model('my_model');
}
public function index() {
$config['functions']['demo'] = array('function' => 'Server.process');
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
public function process($request) {
$parameters = $request->output_parameters();
$data = $this->my_model->getAll();
if (sizeof($data) == 0) {
return $this->xmlrpc->send_error_message('123', 'Requested data not available');
} else {
foreach($data as $item) {
$response[] = array(array('id' => $item->id,
'name' => xml_convert($item->name),
'city' => $item->city,
'status'=> $item->status), 'struct');
}
return $this->xmlrpc->send_response($response);
}
}
}
?>
Error: The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.
I think is because $response array had wrong format, somebody help me !!!