integrate php xmlrpc server

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

Site Timeline