Part of the EllisLab Network
   
 
XML-RPC 301 Error?
Posted: 09 November 2009 08:44 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  31
Joined  08-08-2008

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
Tue10 Nov 2009 00:42:22 GMT
Server
Apache/2.2.11 (Win32PHP/5.2.9-2
Location
http://toejamr.com/federate/
Content-Length236
Connection
close
Content
-Typetext/htmlcharset=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_url80);
        
$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() {
    
    }

 Signature 

————-
James Duffy
.(JavaScript must be enabled to view this email address)

Profile