[eluser]Unknown[/eluser]
Hello,
Im trying to learn to implement CI xmlrpc class, the example given in the documentation is working fine on local system.. if i try to implement the same on the remote system .. im getting the following message
'Did not receive a '200 OK' response from remote server. (HTTP/1.1 404 Not Found)'
Following is the source code and ../application/config.php
Code:
xmlrpc_client.php
============
<?
class Xmlrpc_client extends Controller{
function index()
{
$this->load->helper('url');
$server_url = site_url('http://www.zyx.com/ciprojects/rpc/');
$this->load->library('xmlrpc');
$this->xmlrpc->server($server_url,80);
$this->xmlrpc->method('Greetings');
$request = array('How are you vikram');
$this->xmlrpc->request($request);
if(!$this->xmlrpc->send_request())
{
echo $this->xmlrpc->display_error();
}
else
{
echo '<pre>';
print_r($this->xmlrpc->display_response());
echo '</pre>';
}
}
}
?>
xmlrpc_server.php
==============
<?php
class Xmlrpc_server extends Controller {
function index()
{
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$config['functions']['Greetings'] = array('function'=>'Xmlrpc_server.process');
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
function process($request)
{
$parameters = $request->output_parameters();
$response = array(
array(
'you_said' => $parameters['0'],
'i_respond' => 'Not bad at all.'),
'struct');
return $this->xmlrpc->send_response($response);
}
}
?>
../application/config.php
==========================
/*
|--------------------------------------------------------------------------
| Base Site URL
*/
$config['base_url'] = "http://www.zyx.com/ciprojects/rpc/";