By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 2,006 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

integrate php xmlrpc server

P: n/a
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/';
include 'xmlrpc/';

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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.