3 * Demo server for xmlrpc library.
5 * Implements a lot of webservices, including a suite of services used for
6 * interoperability testing (validator1 methods), and some whose only purpose
7 * is to be used for unit-testing the library.
9 * Please do not copy this file verbatim into your production server.
12 // give user a chance to see the source for this server instead of running the services
13 if ($_SERVER['REQUEST_METHOD'] != 'POST' && isset($_GET['showSource'])) {
14 highlight_file(__FILE__);
18 include_once __DIR__ . "/../../vendor/autoload.php";
20 include_once __DIR__ . "/../../lib/xmlrpc.inc";
21 include_once __DIR__ . "/../../lib/xmlrpcs.inc";
22 include_once __DIR__ . "/../../lib/xmlrpc_wrappers.inc";
25 * Used to test usage of object methods in dispatch maps and in wrapper code.
27 class xmlrpc_server_methods_container
30 * Method used to test logging of php warnings generated by user functions.
32 public function phpwarninggenerator($m)
34 $a = $b; // this triggers a warning in E_ALL mode, since $b is undefined
35 return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
39 * Method used to testcatching of exceptions in the server.
41 public function exceptiongenerator($m)
43 throw new Exception("it's just a test", 1);
47 * a PHP version of the state-number server. Send me an integer and i'll sell you a state
51 public static function findstate($s)
53 return inner_findstate($s);
58 // of the state-number server
59 // send me an integer and i'll sell you a state
62 "Alabama", "Alaska", "Arizona", "Arkansas", "California",
63 "Colorado", "Columbia", "Connecticut", "Delaware", "Florida",
64 "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
65 "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
66 "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
67 "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina",
68 "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
69 "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
70 "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming",
73 $findstate_sig = array(array($xmlrpcString, $xmlrpcInt));
74 $findstate_doc = 'When passed an integer between 1 and 51 returns the
75 name of a US state, where the integer is the index of that state name
76 in an alphabetic order.';
78 function findstate($m)
80 global $xmlrpcerruser, $stateNames;
82 // get the first param
83 $sno = $m->getParam(0);
85 // param must be there and of the correct type: server object does the
88 // extract the value of the state number
89 $snv = $sno->scalarval();
90 // look it up in our array (zero-based)
91 if (isset($stateNames[$snv - 1])) {
92 $sname = $stateNames[$snv - 1];
94 // not, there so complain
95 $err = "I don't have a state for the index '" . $snv . "'";
98 // if we generated an error, create an error return response
100 return new xmlrpcresp(0, $xmlrpcerruser, $err);
102 // otherwise, we create the right response
103 // with the state name
104 return new xmlrpcresp(new xmlrpcval($sname));
109 * Inner code of the state-number server.
110 * Used to test auto-registration of PHP funcions as xmlrpc methods.
112 * @param integer $stateno the state number
114 * @return string the name of the state (or error descrption)
116 function inner_findstate($stateno)
119 if (isset($stateNames[$stateno - 1])) {
120 return $stateNames[$stateno - 1];
122 // not, there so complain
123 return "I don't have a state for the index '" . $stateno . "'";
127 $findstate2_sig = wrap_php_function('inner_findstate');
129 $findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
131 $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
133 $obj = new xmlrpc_server_methods_container();
134 $findstate4_sig = wrap_php_function(array($obj, 'findstate'));
136 $addtwo_sig = array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
137 $addtwo_doc = 'Add two integers together and return the result';
140 $s = $m->getParam(0);
141 $t = $m->getParam(1);
143 return new xmlrpcresp(new xmlrpcval($s->scalarval() + $t->scalarval(), "int"));
146 $addtwodouble_sig = array(array($xmlrpcDouble, $xmlrpcDouble, $xmlrpcDouble));
147 $addtwodouble_doc = 'Add two doubles together and return the result';
148 function addtwodouble($m)
150 $s = $m->getParam(0);
151 $t = $m->getParam(1);
153 return new xmlrpcresp(new xmlrpcval($s->scalarval() + $t->scalarval(), "double"));
156 $stringecho_sig = array(array($xmlrpcString, $xmlrpcString));
157 $stringecho_doc = 'Accepts a string parameter, returns the string.';
158 function stringecho($m)
160 // just sends back a string
161 $s = $m->getParam(0);
162 $v = $s->scalarval();
164 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
167 $echoback_sig = array(array($xmlrpcString, $xmlrpcString));
168 $echoback_doc = 'Accepts a string parameter, returns the entire incoming payload';
169 function echoback($m)
171 // just sends back a string with what i got
172 // sent to me, just escaped, that's all
174 // $m is an incoming message
175 $s = "I got the following message:\n" . $m->serialize();
177 return new xmlrpcresp(new xmlrpcval($s));
180 $echosixtyfour_sig = array(array($xmlrpcString, $xmlrpcBase64));
181 $echosixtyfour_doc = 'Accepts a base64 parameter and returns it decoded as a string';
182 function echosixtyfour($m)
184 // accepts an encoded value, but sends it back
185 // as a normal string. this is to test base64 encoding
186 // is working as expected
187 $incoming = $m->getParam(0);
189 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
192 $bitflipper_sig = array(array($xmlrpcArray, $xmlrpcArray));
193 $bitflipper_doc = 'Accepts an array of booleans, and returns them inverted';
194 function bitflipper($m)
198 $v = $m->getParam(0);
199 $sz = $v->arraysize();
200 $rv = new xmlrpcval(array(), $xmlrpcArray);
202 for ($j = 0; $j < $sz; $j++) {
203 $b = $v->arraymem($j);
204 if ($b->scalarval()) {
205 $rv->addScalar(false, "boolean");
207 $rv->addScalar(true, "boolean");
211 return new xmlrpcresp($rv);
216 // send me an array of structs thus:
223 // and I'll return it to you in sorted order
225 function agesorter_compare($a, $b)
227 global $agesorter_arr;
229 // don't even ask me _why_ these come padded with
230 // hyphens, I couldn't tell you :p
231 $a = str_replace("-", "", $a);
232 $b = str_replace("-", "", $b);
234 if ($agesorter_arr[$a] == $agesorter_arr[$b]) {
238 return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
241 $agesorter_sig = array(array($xmlrpcArray, $xmlrpcArray));
242 $agesorter_doc = 'Send this method an array of [string, int] structs, eg:
249 And the array will be returned with the entries sorted by their numbers.
251 function agesorter($m)
253 global $agesorter_arr, $xmlrpcerruser, $s;
255 xmlrpc_debugmsg("Entering 'agesorter'");
257 $sno = $m->getParam(0);
258 // error string for [if|when] things go wrong
260 // create the output value
261 $v = new xmlrpcval();
264 if (isset($sno) && $sno->kindOf() == "array") {
265 $max = $sno->arraysize();
266 // TODO: create debug method to print can work once more
267 // print "<!-- found $max array elements -->\n";
268 for ($i = 0; $i < $max; $i++) {
269 $rec = $sno->arraymem($i);
270 if ($rec->kindOf() != "struct") {
271 $err = "Found non-struct in array at element $i";
274 // extract name and age from struct
275 $n = $rec->structmem("name");
276 $a = $rec->structmem("age");
277 // $n and $a are xmlrpcvals,
278 // so get the scalarval from them
279 $agar[$n->scalarval()] = $a->scalarval();
282 $agesorter_arr = $agar;
283 // hack, must make global as uksort() won't
284 // allow us to pass any other auxilliary information
285 uksort($agesorter_arr, agesorter_compare);
287 while (list($key, $val) = each($agesorter_arr)) {
288 // recreate each struct element
289 $outAr[] = new xmlrpcval(array("name" => new xmlrpcval($key),
290 "age" => new xmlrpcval($val, "int"),), "struct");
292 // add this array to the output value
293 $v->addArray($outAr);
295 $err = "Must be one parameter, an array of structs";
299 return new xmlrpcresp(0, $xmlrpcerruser, $err);
301 return new xmlrpcresp($v);
305 // signature and instructions, place these in the dispatch
307 $mail_send_sig = array(array(
308 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
309 $xmlrpcString, $xmlrpcString, $xmlrpcString,
310 $xmlrpcString, $xmlrpcString,
313 $mail_send_doc = 'mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
314 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
315 subject is a string, the subject of the message.<br/>
316 sender is a string, it\'s the email address of the person sending the message. This string can not be
317 a comma-separated list, it must contain a single email address only.<br/>
318 text is a string, it contains the body of the message.<br/>
319 mimetype, a string, is a standard MIME type, for example, text/plain.
321 // WARNING; this functionality depends on the sendmail -t option
322 // it may not work with Windows machines properly; particularly
323 // the Bcc option. Sneak on your friends at your own risk!
324 function mail_send($m)
326 global $xmlrpcerruser, $xmlrpcBoolean;
329 $mTo = $m->getParam(0);
330 $mSub = $m->getParam(1);
331 $mBody = $m->getParam(2);
332 $mFrom = $m->getParam(3);
333 $mCc = $m->getParam(4);
334 $mBcc = $m->getParam(5);
335 $mMime = $m->getParam(6);
337 if ($mTo->scalarval() == "") {
338 $err = "Error, no 'To' field specified";
341 if ($mFrom->scalarval() == "") {
342 $err = "Error, no 'From' field specified";
345 $msghdr = "From: " . $mFrom->scalarval() . "\n";
346 $msghdr .= "To: " . $mTo->scalarval() . "\n";
348 if ($mCc->scalarval() != "") {
349 $msghdr .= "Cc: " . $mCc->scalarval() . "\n";
351 if ($mBcc->scalarval() != "") {
352 $msghdr .= "Bcc: " . $mBcc->scalarval() . "\n";
354 if ($mMime->scalarval() != "") {
355 $msghdr .= "Content-type: " . $mMime->scalarval() . "\n";
357 $msghdr .= "X-Mailer: XML-RPC for PHP mailer 1.0";
365 $err = "Error, could not send the mail.";
370 return new xmlrpcresp(0, $xmlrpcerruser, $err);
372 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
376 $getallheaders_sig = array(array($xmlrpcStruct));
377 $getallheaders_doc = 'Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
378 function getallheaders_xmlrpc($m)
380 global $xmlrpcerruser;
381 if (function_exists('getallheaders')) {
382 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
385 // IIS: poor man's version of getallheaders
386 foreach ($_SERVER as $key => $val) {
387 if (strpos($key, 'HTTP_') === 0) {
388 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
389 $headers[$key] = $val;
393 return new xmlrpcresp(php_xmlrpc_encode($headers));
397 $setcookies_sig = array(array($xmlrpcInt, $xmlrpcStruct));
398 $setcookies_doc = 'Sends to client a response containing a single \'1\' digit, and sets to it http cookies as received in the request (array of structs describing a cookie)';
399 function setcookies($m)
401 $m = $m->getParam(0);
402 while (list($name, $value) = $m->structeach()) {
403 $cookiedesc = php_xmlrpc_decode($value);
404 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
407 return new xmlrpcresp(new xmlrpcval(1, 'int'));
410 $getcookies_sig = array(array($xmlrpcStruct));
411 $getcookies_doc = 'Sends to client a response containing all http cookies as received in the request (as struct)';
412 function getcookies($m)
414 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
417 $v1_arrayOfStructs_sig = array(array($xmlrpcInt, $xmlrpcArray));
418 $v1_arrayOfStructs_doc = 'This handler takes a single parameter, an array of structs, each of which contains at least three elements named moe, larry and curly, all <i4>s. Your handler must add all the struct elements named curly and return the result.';
419 function v1_arrayOfStructs($m)
421 $sno = $m->getParam(0);
423 for ($i = 0; $i < $sno->arraysize(); $i++) {
424 $str = $sno->arraymem($i);
426 while (list($key, $val) = $str->structeach()) {
427 if ($key == "curly") {
428 $numcurly += $val->scalarval();
433 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
436 $v1_easyStruct_sig = array(array($xmlrpcInt, $xmlrpcStruct));
437 $v1_easyStruct_doc = 'This handler takes a single parameter, a struct, containing at least three elements named moe, larry and curly, all <i4>s. Your handler must add the three numbers and return the result.';
438 function v1_easyStruct($m)
440 $sno = $m->getParam(0);
441 $moe = $sno->structmem("moe");
442 $larry = $sno->structmem("larry");
443 $curly = $sno->structmem("curly");
444 $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval();
446 return new xmlrpcresp(new xmlrpcval($num, "int"));
449 $v1_echoStruct_sig = array(array($xmlrpcStruct, $xmlrpcStruct));
450 $v1_echoStruct_doc = 'This handler takes a single parameter, a struct. Your handler must return the struct.';
451 function v1_echoStruct($m)
453 $sno = $m->getParam(0);
455 return new xmlrpcresp($sno);
458 $v1_manyTypes_sig = array(array(
459 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
460 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
463 $v1_manyTypes_doc = 'This handler takes six parameters, and returns an array containing all the parameters.';
464 function v1_manyTypes($m)
466 return new xmlrpcresp(new xmlrpcval(array(
477 $v1_moderateSizeArrayCheck_sig = array(array($xmlrpcString, $xmlrpcArray));
478 $v1_moderateSizeArrayCheck_doc = 'This handler takes a single parameter, which is an array containing between 100 and 200 elements. Each of the items is a string, your handler must return a string containing the concatenated text of the first and last elements.';
479 function v1_moderateSizeArrayCheck($m)
481 $ar = $m->getParam(0);
482 $sz = $ar->arraysize();
483 $first = $ar->arraymem(0);
484 $last = $ar->arraymem($sz - 1);
486 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
487 $last->scalarval(), "string"));
490 $v1_simpleStructReturn_sig = array(array($xmlrpcStruct, $xmlrpcInt));
491 $v1_simpleStructReturn_doc = 'This handler takes one parameter, and returns a struct containing three elements, times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000.';
492 function v1_simpleStructReturn($m)
494 $sno = $m->getParam(0);
495 $v = $sno->scalarval();
497 return new xmlrpcresp(new xmlrpcval(array(
498 "times10" => new xmlrpcval($v * 10, "int"),
499 "times100" => new xmlrpcval($v * 100, "int"),
500 "times1000" => new xmlrpcval($v * 1000, "int"),),
505 $v1_nestedStruct_sig = array(array($xmlrpcInt, $xmlrpcStruct));
506 $v1_nestedStruct_doc = 'This handler takes a single parameter, a struct, that models a daily calendar. At the top level, there is one struct for each year. Each year is broken down into months, and months into days. Most of the days are empty in the struct you receive, but the entry for April 1, 2000 contains a least three elements named moe, larry and curly, all <i4>s. Your handler must add the three numbers and return the result.';
507 function v1_nestedStruct($m)
509 $sno = $m->getParam(0);
511 $twoK = $sno->structmem("2000");
512 $april = $twoK->structmem("04");
513 $fools = $april->structmem("01");
514 $curly = $fools->structmem("curly");
515 $larry = $fools->structmem("larry");
516 $moe = $fools->structmem("moe");
518 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
521 $v1_countTheEntities_sig = array(array($xmlrpcStruct, $xmlrpcString));
522 $v1_countTheEntities_doc = 'This handler takes a single parameter, a string, that contains any number of predefined entities, namely <, >, & \' and ".<BR>Your handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes.';
523 function v1_countTheEntities($m)
525 $sno = $m->getParam(0);
526 $str = $sno->scalarval();
532 for ($i = 0; $i < strlen($str); $i++) {
533 $c = substr($str, $i, 1);
555 return new xmlrpcresp(new xmlrpcval(array(
556 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
557 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
558 "ctAmpersands" => new xmlrpcval($amp, "int"),
559 "ctApostrophes" => new xmlrpcval($ap, "int"),
560 "ctQuotes" => new xmlrpcval($qu, "int"),),
565 // trivial interop tests
566 // http://www.xmlrpc.com/stories/storyReader$1636
568 $i_echoString_sig = array(array($xmlrpcString, $xmlrpcString));
569 $i_echoString_doc = "Echoes string.";
571 $i_echoStringArray_sig = array(array($xmlrpcArray, $xmlrpcArray));
572 $i_echoStringArray_doc = "Echoes string array.";
574 $i_echoInteger_sig = array(array($xmlrpcInt, $xmlrpcInt));
575 $i_echoInteger_doc = "Echoes integer.";
577 $i_echoIntegerArray_sig = array(array($xmlrpcArray, $xmlrpcArray));
578 $i_echoIntegerArray_doc = "Echoes integer array.";
580 $i_echoFloat_sig = array(array($xmlrpcDouble, $xmlrpcDouble));
581 $i_echoFloat_doc = "Echoes float.";
583 $i_echoFloatArray_sig = array(array($xmlrpcArray, $xmlrpcArray));
584 $i_echoFloatArray_doc = "Echoes float array.";
586 $i_echoStruct_sig = array(array($xmlrpcStruct, $xmlrpcStruct));
587 $i_echoStruct_doc = "Echoes struct.";
589 $i_echoStructArray_sig = array(array($xmlrpcArray, $xmlrpcArray));
590 $i_echoStructArray_doc = "Echoes struct array.";
592 $i_echoValue_doc = "Echoes any value back.";
593 $i_echoValue_sig = array(array($xmlrpcValue, $xmlrpcValue));
595 $i_echoBase64_sig = array(array($xmlrpcBase64, $xmlrpcBase64));
596 $i_echoBase64_doc = "Echoes base64.";
598 $i_echoDate_sig = array(array($xmlrpcDateTime, $xmlrpcDateTime));
599 $i_echoDate_doc = "Echoes dateTime.";
601 function i_echoParam($m)
603 $s = $m->getParam(0);
605 return new xmlrpcresp($s);
608 function i_echoString($m)
610 return i_echoParam($m);
613 function i_echoInteger($m)
615 return i_echoParam($m);
618 function i_echoFloat($m)
620 return i_echoParam($m);
623 function i_echoStruct($m)
625 return i_echoParam($m);
628 function i_echoStringArray($m)
630 return i_echoParam($m);
633 function i_echoIntegerArray($m)
635 return i_echoParam($m);
638 function i_echoFloatArray($m)
640 return i_echoParam($m);
643 function i_echoStructArray($m)
645 return i_echoParam($m);
648 function i_echoValue($m)
650 return i_echoParam($m);
653 function i_echoBase64($m)
655 return i_echoParam($m);
658 function i_echoDate($m)
660 return i_echoParam($m);
663 $i_whichToolkit_sig = array(array($xmlrpcStruct));
664 $i_whichToolkit_doc = "Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
666 function i_whichToolkit($m)
668 global $xmlrpcName, $xmlrpcVersion, $SERVER_SOFTWARE;
670 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
671 "toolkitName" => $xmlrpcName,
672 "toolkitVersion" => $xmlrpcVersion,
673 "toolkitOperatingSystem" => isset($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE'],
676 return new xmlrpcresp(php_xmlrpc_encode($ret));
679 $o = new xmlrpc_server_methods_container();
681 "examples.getStateName" => array(
682 "function" => "findstate",
683 "signature" => $findstate_sig,
684 "docstring" => $findstate_doc,
686 "examples.sortByAge" => array(
687 "function" => "agesorter",
688 "signature" => $agesorter_sig,
689 "docstring" => $agesorter_doc,
691 "examples.addtwo" => array(
692 "function" => "addtwo",
693 "signature" => $addtwo_sig,
694 "docstring" => $addtwo_doc,
696 "examples.addtwodouble" => array(
697 "function" => "addtwodouble",
698 "signature" => $addtwodouble_sig,
699 "docstring" => $addtwodouble_doc,
701 "examples.stringecho" => array(
702 "function" => "stringecho",
703 "signature" => $stringecho_sig,
704 "docstring" => $stringecho_doc,
706 "examples.echo" => array(
707 "function" => "echoback",
708 "signature" => $echoback_sig,
709 "docstring" => $echoback_doc,
711 "examples.decode64" => array(
712 "function" => "echosixtyfour",
713 "signature" => $echosixtyfour_sig,
714 "docstring" => $echosixtyfour_doc,
716 "examples.invertBooleans" => array(
717 "function" => "bitflipper",
718 "signature" => $bitflipper_sig,
719 "docstring" => $bitflipper_doc,
721 "examples.generatePHPWarning" => array(
722 "function" => array($o, "phpwarninggenerator"),
723 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
725 "examples.raiseException" => array(
726 "function" => array($o, "exceptiongenerator"),
728 "examples.getallheaders" => array(
729 "function" => 'getallheaders_xmlrpc',
730 "signature" => $getallheaders_sig,
731 "docstring" => $getallheaders_doc,
733 "examples.setcookies" => array(
734 "function" => 'setcookies',
735 "signature" => $setcookies_sig,
736 "docstring" => $setcookies_doc,
738 "examples.getcookies" => array(
739 "function" => 'getcookies',
740 "signature" => $getcookies_sig,
741 "docstring" => $getcookies_doc,
743 "mail.send" => array(
744 "function" => "mail_send",
745 "signature" => $mail_send_sig,
746 "docstring" => $mail_send_doc,
748 "validator1.arrayOfStructsTest" => array(
749 "function" => "v1_arrayOfStructs",
750 "signature" => $v1_arrayOfStructs_sig,
751 "docstring" => $v1_arrayOfStructs_doc,
753 "validator1.easyStructTest" => array(
754 "function" => "v1_easyStruct",
755 "signature" => $v1_easyStruct_sig,
756 "docstring" => $v1_easyStruct_doc,
758 "validator1.echoStructTest" => array(
759 "function" => "v1_echoStruct",
760 "signature" => $v1_echoStruct_sig,
761 "docstring" => $v1_echoStruct_doc,
763 "validator1.manyTypesTest" => array(
764 "function" => "v1_manyTypes",
765 "signature" => $v1_manyTypes_sig,
766 "docstring" => $v1_manyTypes_doc,
768 "validator1.moderateSizeArrayCheck" => array(
769 "function" => "v1_moderateSizeArrayCheck",
770 "signature" => $v1_moderateSizeArrayCheck_sig,
771 "docstring" => $v1_moderateSizeArrayCheck_doc,
773 "validator1.simpleStructReturnTest" => array(
774 "function" => "v1_simpleStructReturn",
775 "signature" => $v1_simpleStructReturn_sig,
776 "docstring" => $v1_simpleStructReturn_doc,
778 "validator1.nestedStructTest" => array(
779 "function" => "v1_nestedStruct",
780 "signature" => $v1_nestedStruct_sig,
781 "docstring" => $v1_nestedStruct_doc,
783 "validator1.countTheEntities" => array(
784 "function" => "v1_countTheEntities",
785 "signature" => $v1_countTheEntities_sig,
786 "docstring" => $v1_countTheEntities_doc,
788 "interopEchoTests.echoString" => array(
789 "function" => "i_echoString",
790 "signature" => $i_echoString_sig,
791 "docstring" => $i_echoString_doc,
793 "interopEchoTests.echoStringArray" => array(
794 "function" => "i_echoStringArray",
795 "signature" => $i_echoStringArray_sig,
796 "docstring" => $i_echoStringArray_doc,
798 "interopEchoTests.echoInteger" => array(
799 "function" => "i_echoInteger",
800 "signature" => $i_echoInteger_sig,
801 "docstring" => $i_echoInteger_doc,
803 "interopEchoTests.echoIntegerArray" => array(
804 "function" => "i_echoIntegerArray",
805 "signature" => $i_echoIntegerArray_sig,
806 "docstring" => $i_echoIntegerArray_doc,
808 "interopEchoTests.echoFloat" => array(
809 "function" => "i_echoFloat",
810 "signature" => $i_echoFloat_sig,
811 "docstring" => $i_echoFloat_doc,
813 "interopEchoTests.echoFloatArray" => array(
814 "function" => "i_echoFloatArray",
815 "signature" => $i_echoFloatArray_sig,
816 "docstring" => $i_echoFloatArray_doc,
818 "interopEchoTests.echoStruct" => array(
819 "function" => "i_echoStruct",
820 "signature" => $i_echoStruct_sig,
821 "docstring" => $i_echoStruct_doc,
823 "interopEchoTests.echoStructArray" => array(
824 "function" => "i_echoStructArray",
825 "signature" => $i_echoStructArray_sig,
826 "docstring" => $i_echoStructArray_doc,
828 "interopEchoTests.echoValue" => array(
829 "function" => "i_echoValue",
830 "signature" => $i_echoValue_sig,
831 "docstring" => $i_echoValue_doc,
833 "interopEchoTests.echoBase64" => array(
834 "function" => "i_echoBase64",
835 "signature" => $i_echoBase64_sig,
836 "docstring" => $i_echoBase64_doc,
838 "interopEchoTests.echoDate" => array(
839 "function" => "i_echoDate",
840 "signature" => $i_echoDate_sig,
841 "docstring" => $i_echoDate_doc,
843 "interopEchoTests.whichToolkit" => array(
844 "function" => "i_whichToolkit",
845 "signature" => $i_whichToolkit_sig,
846 "docstring" => $i_whichToolkit_doc,
850 if ($findstate2_sig) {
851 $a['examples.php.getStateName'] = $findstate2_sig;
854 if ($findstate3_sig) {
855 $a['examples.php2.getStateName'] = $findstate3_sig;
858 if ($findstate4_sig) {
859 $a['examples.php3.getStateName'] = $findstate4_sig;
862 if ($findstate5_sig) {
863 $a['examples.php4.getStateName'] = $findstate5_sig;
866 $s = new xmlrpc_server($a, false);
868 $s->compress_response = true;
870 // out-of-band information: let the client manipulate the server operations.
871 // we do this to help the testsuite script: do not reproduce in production!
872 if (isset($_GET['RESPONSE_ENCODING'])) {
873 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
875 if (isset($_GET['EXCEPTION_HANDLING'])) {
876 $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
879 // that should do all we need!