[eluser]JanDoToDo[/eluser]
hey guys,
i just tried to implement the xml rpc class following the user guide and copying code exactly and i get this error message:
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.
Could someone let me know how to turn on xml rpc debugging? Or try and find out where the error is ffrom the user guide?
The client is:
Code:
class Xmlrpc_client extends Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$this -> load -> helper('url');
$this -> load -> library('xmlrpc');
$server_url = 'http://www.mydomain.org/import_data/webservice_dave';
$this -> xmlrpc -> server($server_url, 80);
$this -> xmlrpc -> method('getOrderDetails');
$request = array(array(array('username'=>'delagua'), 'struct'), array(array('password'=>'admin123!'), 'struct'));
$this -> xmlrpc -> request($request);
if ( ! $this -> xmlrpc -> send_request()) :
echo $this -> xmlrpc -> display_error();
echo "hi";
else :
echo "2";
echo '<pre>';
print_r($this -> xmlrpc -> display_response());
echo '</pre>';
endif;
}
}
The server is copied from the user guide as such:
Code:
function webservice_dave()
{
$this -> load -> library('xmlrpc');
$this -> load -> library('xmlrpcs');
$config['functions']['getOrderDetails'] = array('function' => 'import_data.get_order');
$config['object'] = $this;
$this -> xmlrpcs -> initialize($config);
$this -> xmlrpcs -> serve();
}
function get_order($request)
{
$username = 'delagua';
$password = 'admin123!';
$this -> load -> library('xmlrpc');
$parameters = $request -> output_parameters();
if ($parameters['1'] != $username AND $parameters['2'] != $password)
{
return $this -> xmlrpc -> send_error_message('100', 'Invalid Access');
}
$response = array(
array(
'you_said' => $parameters['1'],
'i_respond' => 'Not bad at all.'),
'struct');
return $this -> xmlrpc -> send_response($response);
}