Part of the EllisLab Network
   
 
[Duplicate, Sorry!] XMLRPC cannot map external class functions. 
Posted: 13 June 2008 07:15 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  758
Joined  09-25-2007

http://codeigniter.com/forums/viewthread/82317/
I am using CI 1.6.2

//client
...
        
$this->xmlrpc->method('GetNews');
        
$request = array('How is it going?');
        
$this->xmlrpc->request($request);
...

//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?

Profile
 
 
Posted: 14 June 2008 06:18 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  758
Joined  09-25-2007

Apologies this has already been discovered and logged

http://codeigniter.com/bug_tracker/bug/4300/

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 60338 Total Logged-in Users: 29
Total Topics: 72442 Total Anonymous Users: 2
Total Replies: 390606 Total Guests: 319
Total Posts: 463048    
Members ( View Memberlist )
Newest Members:  chrispaulUbu RoiNokrosisxTaticbrookerrjNIBBSDUBLINZeroHCSteve Cperiklisgsquared