I can’t get around this error and I don’t know what to do. Thanks for any help.
Error in browser.
---DATA---
HTTP/1.1 301 Moved Permanently
Date: Tue, 10 Nov 2009 00:42:22 GMT
Server: Apache/2.2.11 (Win32) PHP/5.2.9-2
Location: http://toejamr.com/federate/
Content-Length: 236
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://toejamr.com/federate/">here</a>.</p>
</body></html>
---END DATA---
Did not receive a '200 OK' response from remote server. (HTTP/1.1 301 Moved Permanently)
Client Controller:
<?php
Class Test extends Controller{
function Test() {
parent::Controller();
}
function index() {
$server_url = site_url('federate');
$this->load->library('xmlrpc');
$this->xmlrpc->set_debug(TRUE);
$this->xmlrpc->server($server_url, 80);
$this->xmlrpc->method('ping');
$request = array('How is it going?');
$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>';
}
}
}
Server Code:
<?php
Class Federate extends Controller {
function Federate() {
parent::Controller();
/* Lets load the XML-RPC and XML-RPCS Libraries. */
$this->load->library( array('xmlrpc') );
}
function index() {
$this->load->library('xmlrpcs');
/* Lets list all the methods provided by this server. */
$config['functions']['ping'] = array('function' => 'Federate.ping');
$config['functions']['subscribe'] = array('function' => 'Federate.SubscribeToUser');
$config['functions']['unsubscribe'] = array('function' => 'Federate.UnSubscribeToUser');
$config['functions']['message'] = array('function' => 'Federate.SendUserMessage');
$config['object'] = $this;
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
function ping($request=NULL) {
$response = array(
array(
'server' => array('http://toejamr.com/','string'),
'port' => array('80','string'),
'status' => array('Online','string')
),
'struct'
);
return $this->xmlrpc->send_response($response)
}
function SubscribeToUser() {
}
function UnSubscribeToUser() {
}
function SendUserMessage() {
}
}
