Welcome Guest, Not a member yet? Register   Sign In
XML-RPC Server functions delegation
#1

[eluser]eMSi_113[/eluser]
Hello Everyone,

I'm experiencing problems with setting up the xmlrpc server.
Here's my config:
Code:
$config['functions']['my_class.my_method'] = array('function' => 'my_class.my_method');
$config['object'] = $this;
$this->xmlrpcs->initialize($config);
Now. I have tried creating a controller in controllers folder:
Code:
class challenges extends Controller
{
    function my_method($request) { /* code */ }
}

and library in libraries folder similarily but it looks like CodeIgniter's XMLRPC Server library doesn't delegate the call. From what I looked up in Xmlrpcs.php source code it just does is_callable(array('my_class','my_method') and of course this won't work because my_class isn't loaded while in manual it does say:

Quote:your server will load the my_class class and call the my_method function.

Any ideas what I'm doing wrong? Should I autoload the library/controller (and I don't like this idea)?
#2

[eluser]eMSi_113[/eluser]
noone? really?
#3

[eluser]coolfactor[/eluser]
I'm having the same problem. I also have my server call inside a library-like class (not a true CodeIgniter library, but loaded and attached to the controller instance in the same way). The XML-RPC server fails to call the method. Here's my config:
Code:
// initialize server
$config['functions']['pingback.ping'] = array('function' => 'MyBlog.process_pingback');
$config['object'] = $this;  // reference to MyBlog object
$this->CI->xmlrpcs->initialize($config);
$this->CI->xmlrpcs->serve();

I'm just closing in on a solution, or at least isolating the problem. I'll report back when I learn more.
#4

[eluser]coolfactor[/eluser]
[quote author="eMSi_113" date="1265998977"]Hello Everyone,

I'm experiencing problems with setting up the xmlrpc server.
Here's my config:
Code:
$config['functions']['my_class.my_method'] = array('function' => 'my_class.my_method');
$config['object'] = $this;
$this->xmlrpcs->initialize($config);
[/quote]

It would be helpful if you provided the *actual* code you're using, unless you are using "my_class" and "my_method" as actual class and method names? That wouldn't make much sense, so reply back with your actual code.

I discovered my handler function was being called properly, but I wasn't returning an expected result from it, so this was the source of my grief.
#5

[eluser]eMSi_113[/eluser]
Here's the code:

Code:
$config['functions']['challenges.send'] = array('function' => 'challenges.send');
$config['object'] = $this;
$this->xmlrpcs->initialize($config);

Controller:
Code:
class challenges extends Controller
{
    function send($request) { /* code */ }
}

that's all there is really.




Theme © iAndrew 2016 - Forum software by © MyBB