470,609 Members | 1,248 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,609 developers. It's quick & easy.

integrate php xmlrpc server

Hi I am trying to integrate the xmlrpc server into a class, does anyone
know how to get it working?

<title>XMLRPC Test</title>
<script src="jsolait/init.js"></script>
<script src="jsolait/lib/urllib.js"></script>
<script src="jsolait/lib/xml.js"></script>
<script src="jsolait/lib/xmlrpc.js"></script>

var xmlrpc=null;
var xmlrpc = importModule("xmlrpc");
throw "importing of xmlrpc module failed.";
doSome = function()
var service = new
var something = service.Server.display();

<body bgcolor="#D4D0C8">
<a href="javascript:doSome()">click</a>

and test.php side:
include 'xmlrpc/xmlrpc.inc';
include 'xmlrpc/xmlrpcs.inc';

class Server
function Server()

function sumAndDifference ($params) {
$xval = $params->getParam(0);
$x = $xval->scalarval();
$yval = $params->getParam(1);
$y = $yval->scalarval();

// Build our response.
$struct = array('sum' => new xmlrpcval($x + $y, 'int'),
'difference' => new xmlrpcval($x - $y, 'int'));
return new xmlrpcresp(new xmlrpcval($struct, 'struct'));

function display()

return new xmlrpcresp(new xmlrpcval("James",

function makeServer()
$sumAndDifference_sig = array(array('struct', 'int',
$sumAndDifference_doc = 'Add and subtract two numbers';

$display_sig = array(array('struct'));
$display_doc = 'Add and subtract two numbers';

new xmlrpc_server(array('server.sumAndDifference' =>
array('function' => 'sumAndDifference',
'signature' => $sumAndDifference_sig,
'docstring' => $sumAndDifference_doc),
array('function' => 'Server.display',
'signature' => $display_sig,
'docstring' => $display_doc)

$test = new Server();
$server = $test->makeServer();

Thanks in advance

Jul 17 '05 #1
0 1643

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Juan Carlos CORUA | last post: by
1 post views Thread by Joxean Koret | last post: by
1 post views Thread by emielvl | last post: by
3 posts views Thread by David Hirschfield | last post: by
6 posts views Thread by half.italian | last post: by
1 post views Thread by Sean Davis | last post: by
reply views Thread by Benjamin Grieshaber | last post: by
4 posts views Thread by care02 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.