CodeIgniter Forums

Full Version: [Duplicate, Sorry!] XMLRPC cannot map external class functions.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]gtech[/eluser]
[url="http://ellislab.com/forums/viewthread/82317/"]http://ellislab.com/forums/viewthread/82317/[/url]
I am using CI 1.6.2
Code:
//client
...
        $this->xmlrpc->method('GetNews');
        $request = array('How is it going?');
        $this->xmlrpc->request($request);
...
Code:
//server (class xmlserver)
...
    // >News controller exists with _GetNews fucntion but
    // you get a method does not exist error.
    // >When you move the _GetNews function to this controller
    // it will work
    $config['functions']['GetNews'] = array('function'=>'News._GetNews');
    //$config['functions']['GetNews'] = array('function'=>'Xmlserver._GetNews');
        
    $this->xmlrpcs->initialize($config);
    $this->xmlrpcs->serve();
...

You cannot map functions that are in another controller outside the server controller.

why you may ask?

It fails on line 270 of the xmlrpcs.php code, as its trying to use is_callable on a controller/method that has not been loaded in the request, and so it fails.

Also if you look at line 325 of xmlrpcs.php there is commented out code which attempts to call an external controller but has obviously been commented out as it did not work, however the code will never get this far as it fails gracefully on line 270.

when you set up the functions array you have to precede the method name with the controller name, so it would imply that this should work.

Is the xmlrpc code designed to map to other controllers?
Is this a bug or a feature request?

El Forum

[eluser]gtech[/eluser]
Apologies this has already been discovered and logged

[url="http://codeigniter.com/bug_tracker/bug/4300/"]http://codeigniter.com/bug_tracker/bug/4300/[/url]