CodeIgniter Forums
xml-rpc server using a function in another Controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: xml-rpc server using a function in another Controller (/thread-29992.html)



xml-rpc server using a function in another Controller - El Forum - 04-28-2010

[eluser]Unknown[/eluser]
Hello all,

Was wondering if someone could shed some light on the following for me please:

I have a Controller: Server_live that will act as my entry point for the XML-RPC server I am creating, the index function has the following:

$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');

$config['functions']['connectiontest'] = array('function' => 'System_utilities.connectiontest');

$config['object'] = $this;
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();

I have another controller called System_utilities which has a function connectiontest which takes a single parameter of $request.

Now when I try to call the connectiontest function from my client I receive an error back from the server stating that the Server does not have a function called connectiontest.

I managed to get it working by changing the mapping to be Server_live.connectiontest and add the function to the same controller as the Index() function above but this is not ideal and I would love to have the functions spread out all over the place so as to not make this single file absolute huge.

I have tried everything I can think of and the only way seems to be if they are in the same controller, surely this is not the case though.

Any ideas welcomed,

Thanks
.FxN