Welcome Guest, Not a member yet? Register   Sign In
sample xml-rpc code
#1

[eluser]Unknown[/eluser]
i am new to code igniter, i could not take off using code-igniter's xml-rpc library.. does anyone have a quick and dirty sample of xml-rpc serving and requesting just a simple write to a text file so i could understand it?

in your user guide i could not find the method new_entry... where is it written? in another controller? please help me..
$config['functions]['new_post'] = array('function' => 'My_blog.new_entry'),
#2

[eluser]HdotNET[/eluser]
the manual only covers a simple call / response example with actual code. the rest is metaphorical.
#3

[eluser]gtech[/eluser]
if you scroll down the page a bit to

Creating Your Own Client and Server

you will find a working example of a client and server, is that what you are after?
#4

[eluser]Unknown[/eluser]
yes i tried the samples. i just dont know where to put the class that it calls.. will it be a new controller? how can i shield it from view from not a xml-rpc call?
#5

[eluser]gtech[/eluser]
OK I assume you have the client and server example working

in the server code you can map XMLRPC calls to any function in any controller,
Code:
$config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');
$config['functions']['Another'] = array('function' => 'Another_controller.functionname');
the example above uses Xmlrpc_server.process ... Xmlrpc_server being the controller name and process being the function.

if you want to shield the function from the webbrowser you can use an underscore before the function name

Xmlrpc_server._process

or

Another_controller._anotherfunction

Code:
......
    $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server._process');
......        

    function _process($request)
    {
      //this function is only callable from XMLRPC interface.
......
?>

does that help?




Theme © iAndrew 2016 - Forum software by © MyBB