function i_echoBase64($m) { return i_echoParam($m); } function i_echoDate($m) { return i_echoParam($m); } $i_whichToolkit_sig = array(array($xmlrpcStruct)); $i_whichToolkit_doc = "Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem."; function i_whichToolkit($m) { global $xmlrpcName, $xmlrpcVersion, $SERVER_SOFTWARE; $ret = array("toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/", "toolkitName" => $xmlrpcName, "toolkitVersion" => $xmlrpcVersion, "toolkitOperatingSystem" => isset($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']); return new xmlrpcresp(php_xmlrpc_encode($ret)); } $o = new xmlrpc_server_methods_container(); $a = array("examples.getStateName" => array("function" => "findstate", "signature" => $findstate_sig, "docstring" => $findstate_doc), "examples.sortByAge" => array("function" => "agesorter", "signature" => $agesorter_sig, "docstring" => $agesorter_doc), "examples.addtwo" => array("function" => "addtwo", "signature" => $addtwo_sig, "docstring" => $addtwo_doc), "examples.addtwodouble" => array("function" => "addtwodouble", "signature" => $addtwodouble_sig, "docstring" => $addtwodouble_doc), "examples.stringecho" => array("function" => "stringecho", "signature" => $stringecho_sig, "docstring" => $stringecho_doc), "examples.echo" => array("function" => "echoback", "signature" => $echoback_sig, "docstring" => $echoback_doc), "examples.decode64" => array("function" => "echosixtyfour", "signature" => $echosixtyfour_sig, "docstring" => $echosixtyfour_doc), "examples.invertBooleans" => array("function" => "bitflipper", "signature" => $bitflipper_sig, "docstring" => $bitflipper_doc), "examples.generatePHPWarning" => array("function" => array($o, "phpwarninggenerator")), "examples.getallheaders" => array("function" => 'getallheaders_xmlrpc', "signature" => $getallheaders_sig, "docstring" => $getallheaders_doc), "examples.setcookies" => array("function" => 'setcookies', "signature" => $setcookies_sig, "docstring" => $setcookies_doc), "mail.send" => array("function" => "mail_send", "signature" => $mail_send_sig, "docstring" => $mail_send_doc), "validator1.arrayOfStructsTest" => array("function" => "v1_arrayOfStructs", "signature" => $v1_arrayOfStructs_sig, "docstring" => $v1_arrayOfStructs_doc), "validator1.easyStructTest" => array("function" => "v1_easyStruct", "signature" => $v1_easyStruct_sig, "docstring" => $v1_easyStruct_doc), "validator1.echoStructTest" => array("function" => "v1_echoStruct", "signature" => $v1_echoStruct_sig, "docstring" => $v1_echoStruct_doc), "validator1.manyTypesTest" => array("function" => "v1_manyTypes", "signature" => $v1_manyTypes_sig, "docstring" => $v1_manyTypes_doc), "validator1.moderateSizeArrayCheck" => array("function" => "v1_moderateSizeArrayCheck", "signature" => $v1_moderateSizeArrayCheck_sig, "docstring" => $v1_moderateSizeArrayCheck_doc), "validator1.simpleStructReturnTest" => array("function" => "v1_simpleStructReturn", "signature" => $v1_simpleStructReturn_sig, "docstring" => $v1_simpleStructReturn_doc), "validator1.nestedStructTest" => array("function" => "v1_nestedStruct", "signature" => $v1_nestedStruct_sig, "docstring" => $v1_nestedStruct_doc), "validator1.countTheEntities" => array("function" => "v1_countTheEntities", "signature" => $v1_countTheEntities_sig, "docstring" => $v1_countTheEntities_doc), "interopEchoTests.echoString" => array("function" => "i_echoString", "signature" => $i_echoString_sig, "docstring" => $i_echoString_doc), "interopEchoTests.echoStringArray" => array("function" => "i_echoStringArray", "signature" => $i_echoStringArray_sig, "docstring" => $i_echoStringArray_doc), "interopEchoTests.echoInteger" => array("function" => "i_echoInteger", "signature" => $i_echoInteger_sig, "docstring" => $i_echoInteger_doc), "interopEchoTests.echoIntegerArray" => array("function" => "i_echoIntegerArray", "signature" => $i_echoIntegerArray_sig, "docstring" => $i_echoIntegerArray_doc), "interopEchoTests.echoFloat" => array("function" => "i_echoFloat", "signature" => $i_echoFloat_sig, "docstring" => $i_echoFloat_doc), "interopEchoTests.echoFloatArray" => array("function" => "i_echoFloatArray", "signature" => $i_echoFloatArray_sig, "docstring" => $i_echoFloatArray_doc), "interopEchoTests.echoStruct" => array("function" => "i_echoStruct", "signature" => $i_echoStruct_sig, "docstring" => $i_echoStruct_doc), "interopEchoTests.echoStructArray" => array("function" => "i_echoStructArray", "signature" => $i_echoStructArray_sig, "docstring" => $i_echoStructArray_doc), "interopEchoTests.echoValue" => array("function" => "i_echoValue", "signature" => $i_echoValue_sig, "docstring" => $i_echoValue_doc), "interopEchoTests.echoBase64" => array("function" => "i_echoBase64", "signature" => $i_echoBase64_sig, "docstring" => $i_echoBase64_doc), "interopEchoTests.echoDate" => array("function" => "i_echoDate", "signature" => $i_echoDate_sig, "docstring" => $i_echoDate_doc), "interopEchoTests.whichToolkit" => array("function" => "i_whichToolkit", "signature" => $i_whichToolkit_sig, "docstring" => $i_whichToolkit_doc)); if ($findstate2_sig) { $a['examples.php.getStateName'] = $findstate2_sig; } $s = new jsonrpc_server($a, false); $s->setdebug(3); $s->compress_response = true; // out-of-band information: let the client manipulate the server operations. // we do this to help the testsuite script: do not reproduce in production! if (isset($_GET['RESPONSE_ENCODING'])) { $s->response_charset_encoding = $_GET['RESPONSE_ENCODING']; } $s->service(); // that should do all we need!
<?php # Lifter002: TODO # Lifter007: TODO # Lifter003: TODO # Lifter010: TODO /* * jsonrpc.php - JSON-RPC Backend for Stud.IP web services * * Copyright (C) 2006 - Marcus Lunzenauer <*****@*****.**> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ require '../lib/bootstrap.php'; require '../lib/webservices/webservices_bootstrap.php'; # create server $dispatcher = new Studip_Ws_JsonrpcDispatcher($AVAILABLE_SERVICES); $server = new jsonrpc_server($dispatcher->get_dispatch_map(), 0); # $server->setDebug(3); # $server->compress_response = FALSE; # start server $server->service();