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.
14 // give user a chance to see the source for this server instead of running the services
15 if ($_SERVER['REQUEST_METHOD'] != 'POST' && isset($_GET['showSource']))
17 highlight_file(__FILE__);
21 include("xmlrpc.inc");
22 include("xmlrpcs.inc");
23 include("xmlrpc_wrappers.inc");
26 * Used to test usage of object methods in dispatch maps and in wrapper code
28 class xmlrpc_server_methods_container
31 * Method used to test logging of php warnings generated by user functions.
33 function phpwarninggenerator($m)
35 $a = $b; // this triggers a warning in E_ALL mode, since $b is undefined
36 return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
40 * Method used to testcatching of exceptions in the server.
42 function exceptiongenerator($m)
44 throw new Exception("it's just a test", 1);
48 * a PHP version of the state-number server. Send me an integer and i'll sell you a state
52 static function findstate($s)
54 return inner_findstate($s);
60 // of the state-number server
61 // send me an integer and i'll sell you a state
64 "Alabama", "Alaska", "Arizona", "Arkansas", "California",
65 "Colorado", "Columbia", "Connecticut", "Delaware", "Florida",
66 "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
67 "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
68 "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
69 "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina",
70 "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
71 "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
72 "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"
75 $findstate_sig=array(array($xmlrpcString, $xmlrpcInt));
76 $findstate_doc='When passed an integer between 1 and 51 returns the
77 name of a US state, where the integer is the index of that state name
78 in an alphabetic order.';
81 function findstate($m)
83 global $xmlrpcerruser, $stateNames;
85 // get the first param
88 // param must be there and of the correct type: server object does the
91 // extract the value of the state number
92 $snv=$sno->scalarval();
93 // look it up in our array (zero-based)
94 if (isset($stateNames[$snv-1]))
96 $sname=$stateNames[$snv-1];
100 // not, there so complain
101 $err="I don't have a state for the index '" . $snv . "'";
104 // if we generated an error, create an error return response
107 return new xmlrpcresp(0, $xmlrpcerruser, $err);
111 // otherwise, we create the right response
112 // with the state name
113 return new xmlrpcresp(new xmlrpcval($sname));
118 * Inner code of the state-number server.
119 * Used to test auto-registration of PHP funcions as xmlrpc methods.
120 * @param integer $stateno the state number
121 * @return string the name of the state (or error descrption)
123 function inner_findstate($stateno)
126 if (isset($stateNames[$stateno-1]))
128 return $stateNames[$stateno-1];
132 // not, there so complain
133 return "I don't have a state for the index '" . $stateno . "'";
136 $findstate2_sig = wrap_php_function('inner_findstate');
138 $findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
140 $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
142 $obj = new xmlrpc_server_methods_container();
143 $findstate4_sig = wrap_php_function(array($obj, 'findstate'));
145 $addtwo_sig=array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
146 $addtwo_doc='Add two integers together and return the result';
151 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"int"));
154 $addtwodouble_sig=array(array($xmlrpcDouble, $xmlrpcDouble, $xmlrpcDouble));
155 $addtwodouble_doc='Add two doubles together and return the result';
156 function addtwodouble($m)
160 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"double"));
163 $stringecho_sig=array(array($xmlrpcString, $xmlrpcString));
164 $stringecho_doc='Accepts a string parameter, returns the string.';
165 function stringecho($m)
167 // just sends back a string
169 $v = $s->scalarval();
170 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
173 $echoback_sig=array(array($xmlrpcString, $xmlrpcString));
174 $echoback_doc='Accepts a string parameter, returns the entire incoming payload';
175 function echoback($m)
177 // just sends back a string with what i got
178 // sent to me, just escaped, that's all
180 // $m is an incoming message
181 $s="I got the following message:\n" . $m->serialize();
182 return new xmlrpcresp(new xmlrpcval($s));
185 $echosixtyfour_sig=array(array($xmlrpcString, $xmlrpcBase64));
186 $echosixtyfour_doc='Accepts a base64 parameter and returns it decoded as a string';
187 function echosixtyfour($m)
189 // accepts an encoded value, but sends it back
190 // as a normal string. this is to test base64 encoding
191 // is working as expected
192 $incoming=$m->getParam(0);
193 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
196 $bitflipper_sig=array(array($xmlrpcArray, $xmlrpcArray));
197 $bitflipper_doc='Accepts an array of booleans, and returns them inverted';
198 function bitflipper($m)
204 $rv=new xmlrpcval(array(), $xmlrpcArray);
206 for($j=0; $j<$sz; $j++)
211 $rv->addScalar(false, "boolean");
215 $rv->addScalar(true, "boolean");
219 return new xmlrpcresp($rv);
224 // send me an array of structs thus:
231 // and I'll return it to you in sorted order
233 function agesorter_compare($a, $b)
235 global $agesorter_arr;
237 // don't even ask me _why_ these come padded with
238 // hyphens, I couldn't tell you :p
239 $a=str_replace("-", "", $a);
240 $b=str_replace("-", "", $b);
242 if ($agesorter_arr[$a]==$agesorter[$b])
246 return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
249 $agesorter_sig=array(array($xmlrpcArray, $xmlrpcArray));
250 $agesorter_doc='Send this method an array of [string, int] structs, eg:
257 And the array will be returned with the entries sorted by their numbers.
259 function agesorter($m)
261 global $agesorter_arr, $xmlrpcerruser, $s;
263 xmlrpc_debugmsg("Entering 'agesorter'");
265 $sno=$m->getParam(0);
266 // error string for [if|when] things go wrong
268 // create the output value
272 if (isset($sno) && $sno->kindOf()=="array")
274 $max=$sno->arraysize();
275 // TODO: create debug method to print can work once more
276 // print "<!-- found $max array elements -->\n";
277 for($i=0; $i<$max; $i++)
279 $rec=$sno->arraymem($i);
280 if ($rec->kindOf()!="struct")
282 $err="Found non-struct in array at element $i";
285 // extract name and age from struct
286 $n=$rec->structmem("name");
287 $a=$rec->structmem("age");
288 // $n and $a are xmlrpcvals,
289 // so get the scalarval from them
290 $agar[$n->scalarval()]=$a->scalarval();
293 $agesorter_arr=$agar;
294 // hack, must make global as uksort() won't
295 // allow us to pass any other auxilliary information
296 uksort($agesorter_arr, agesorter_compare);
298 while (list( $key, $val ) = each( $agesorter_arr ) )
300 // recreate each struct element
301 $outAr[]=new xmlrpcval(array("name" =>
304 new xmlrpcval($val, "int")), "struct");
306 // add this array to the output value
307 $v->addArray($outAr);
311 $err="Must be one parameter, an array of structs";
316 return new xmlrpcresp(0, $xmlrpcerruser, $err);
320 return new xmlrpcresp($v);
324 // signature and instructions, place these in the dispatch
326 $mail_send_sig=array(array(
327 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
328 $xmlrpcString, $xmlrpcString, $xmlrpcString,
329 $xmlrpcString, $xmlrpcString
332 $mail_send_doc='mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
333 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
334 subject is a string, the subject of the message.<br/>
335 sender is a string, it\'s the email address of the person sending the message. This string can not be
336 a comma-separated list, it must contain a single email address only.<br/>
337 text is a string, it contains the body of the message.<br/>
338 mimetype, a string, is a standard MIME type, for example, text/plain.
340 // WARNING; this functionality depends on the sendmail -t option
341 // it may not work with Windows machines properly; particularly
342 // the Bcc option. Sneak on your friends at your own risk!
343 function mail_send($m)
345 global $xmlrpcerruser, $xmlrpcBoolean;
348 $mTo=$m->getParam(0);
349 $mSub=$m->getParam(1);
350 $mBody=$m->getParam(2);
351 $mFrom=$m->getParam(3);
352 $mCc=$m->getParam(4);
353 $mBcc=$m->getParam(5);
354 $mMime=$m->getParam(6);
356 if ($mTo->scalarval()=="")
358 $err="Error, no 'To' field specified";
361 if ($mFrom->scalarval()=="")
363 $err="Error, no 'From' field specified";
366 $msghdr="From: " . $mFrom->scalarval() . "\n";
367 $msghdr.="To: ". $mTo->scalarval() . "\n";
369 if ($mCc->scalarval()!="")
371 $msghdr.="Cc: " . $mCc->scalarval(). "\n";
373 if ($mBcc->scalarval()!="")
375 $msghdr.="Bcc: " . $mBcc->scalarval(). "\n";
377 if ($mMime->scalarval()!="")
379 $msghdr.="Content-type: " . $mMime->scalarval() . "\n";
381 $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0";
390 $err="Error, could not send the mail.";
396 return new xmlrpcresp(0, $xmlrpcerruser, $err);
400 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
404 $getallheaders_sig=array(array($xmlrpcStruct));
405 $getallheaders_doc='Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
406 function getallheaders_xmlrpc($m)
408 global $xmlrpcerruser;
409 if (function_exists('getallheaders'))
411 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
416 // IIS: poor man's version of getallheaders
417 foreach ($_SERVER as $key => $val)
418 if (strpos($key, 'HTTP_') === 0)
420 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
421 $headers[$key] = $val;
423 return new xmlrpcresp(php_xmlrpc_encode($headers));
427 $setcookies_sig=array(array($xmlrpcInt, $xmlrpcStruct));
428 $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)';
429 function setcookies($m)
431 $m = $m->getParam(0);
432 while(list($name,$value) = $m->structeach())
434 $cookiedesc = php_xmlrpc_decode($value);
435 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
437 return new xmlrpcresp(new xmlrpcval(1, 'int'));
440 $getcookies_sig=array(array($xmlrpcStruct));
441 $getcookies_doc='Sends to client a response containing all http cookies as received in the request (as struct)';
442 function getcookies($m)
444 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
447 $v1_arrayOfStructs_sig=array(array($xmlrpcInt, $xmlrpcArray));
448 $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.';
449 function v1_arrayOfStructs($m)
451 $sno=$m->getParam(0);
453 for($i=0; $i<$sno->arraysize(); $i++)
455 $str=$sno->arraymem($i);
457 while(list($key,$val)=$str->structeach())
461 $numcurly+=$val->scalarval();
465 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
468 $v1_easyStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
469 $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.';
470 function v1_easyStruct($m)
472 $sno=$m->getParam(0);
473 $moe=$sno->structmem("moe");
474 $larry=$sno->structmem("larry");
475 $curly=$sno->structmem("curly");
476 $num=$moe->scalarval() + $larry->scalarval() + $curly->scalarval();
477 return new xmlrpcresp(new xmlrpcval($num, "int"));
480 $v1_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
481 $v1_echoStruct_doc='This handler takes a single parameter, a struct. Your handler must return the struct.';
482 function v1_echoStruct($m)
484 $sno=$m->getParam(0);
485 return new xmlrpcresp($sno);
488 $v1_manyTypes_sig=array(array(
489 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
490 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
493 $v1_manyTypes_doc='This handler takes six parameters, and returns an array containing all the parameters.';
494 function v1_manyTypes($m)
496 return new xmlrpcresp(new xmlrpcval(array(
507 $v1_moderateSizeArrayCheck_sig=array(array($xmlrpcString, $xmlrpcArray));
508 $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.';
509 function v1_moderateSizeArrayCheck($m)
512 $sz=$ar->arraysize();
513 $first=$ar->arraymem(0);
514 $last=$ar->arraymem($sz-1);
515 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
516 $last->scalarval(), "string"));
519 $v1_simpleStructReturn_sig=array(array($xmlrpcStruct, $xmlrpcInt));
520 $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.';
521 function v1_simpleStructReturn($m)
523 $sno=$m->getParam(0);
524 $v=$sno->scalarval();
525 return new xmlrpcresp(new xmlrpcval(array(
526 "times10" => new xmlrpcval($v*10, "int"),
527 "times100" => new xmlrpcval($v*100, "int"),
528 "times1000" => new xmlrpcval($v*1000, "int")),
533 $v1_nestedStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
534 $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.';
535 function v1_nestedStruct($m)
537 $sno=$m->getParam(0);
539 $twoK=$sno->structmem("2000");
540 $april=$twoK->structmem("04");
541 $fools=$april->structmem("01");
542 $curly=$fools->structmem("curly");
543 $larry=$fools->structmem("larry");
544 $moe=$fools->structmem("moe");
545 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
548 $v1_countTheEntities_sig=array(array($xmlrpcStruct, $xmlrpcString));
549 $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.';
550 function v1_countTheEntities($m)
552 $sno=$m->getParam(0);
553 $str=$sno->scalarval();
554 $gt=0; $lt=0; $ap=0; $qu=0; $amp=0;
555 for($i=0; $i<strlen($str); $i++)
557 $c=substr($str, $i, 1);
579 return new xmlrpcresp(new xmlrpcval(array(
580 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
581 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
582 "ctAmpersands" => new xmlrpcval($amp, "int"),
583 "ctApostrophes" => new xmlrpcval($ap, "int"),
584 "ctQuotes" => new xmlrpcval($qu, "int")),
589 // trivial interop tests
590 // http://www.xmlrpc.com/stories/storyReader$1636
592 $i_echoString_sig=array(array($xmlrpcString, $xmlrpcString));
593 $i_echoString_doc="Echoes string.";
595 $i_echoStringArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
596 $i_echoStringArray_doc="Echoes string array.";
598 $i_echoInteger_sig=array(array($xmlrpcInt, $xmlrpcInt));
599 $i_echoInteger_doc="Echoes integer.";
601 $i_echoIntegerArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
602 $i_echoIntegerArray_doc="Echoes integer array.";
604 $i_echoFloat_sig=array(array($xmlrpcDouble, $xmlrpcDouble));
605 $i_echoFloat_doc="Echoes float.";
607 $i_echoFloatArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
608 $i_echoFloatArray_doc="Echoes float array.";
610 $i_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
611 $i_echoStruct_doc="Echoes struct.";
613 $i_echoStructArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
614 $i_echoStructArray_doc="Echoes struct array.";
616 $i_echoValue_doc="Echoes any value back.";
617 $i_echoValue_sig=array(array($xmlrpcValue, $xmlrpcValue));
619 $i_echoBase64_sig=array(array($xmlrpcBase64, $xmlrpcBase64));
620 $i_echoBase64_doc="Echoes base64.";
622 $i_echoDate_sig=array(array($xmlrpcDateTime, $xmlrpcDateTime));
623 $i_echoDate_doc="Echoes dateTime.";
625 function i_echoParam($m)
628 return new xmlrpcresp($s);
631 function i_echoString($m) { return i_echoParam($m); }
632 function i_echoInteger($m) { return i_echoParam($m); }
633 function i_echoFloat($m) { return i_echoParam($m); }
634 function i_echoStruct($m) { return i_echoParam($m); }
635 function i_echoStringArray($m) { return i_echoParam($m); }
636 function i_echoIntegerArray($m) { return i_echoParam($m); }
637 function i_echoFloatArray($m) { return i_echoParam($m); }
638 function i_echoStructArray($m) { return i_echoParam($m); }
639 function i_echoValue($m) { return i_echoParam($m); }
640 function i_echoBase64($m) { return i_echoParam($m); }
641 function i_echoDate($m) { return i_echoParam($m); }
643 $i_whichToolkit_sig=array(array($xmlrpcStruct));
644 $i_whichToolkit_doc="Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
646 function i_whichToolkit($m)
648 global $xmlrpcName, $xmlrpcVersion,$SERVER_SOFTWARE;
650 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
651 "toolkitName" => $xmlrpcName,
652 "toolkitVersion" => $xmlrpcVersion,
653 "toolkitOperatingSystem" => isset ($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']
655 return new xmlrpcresp ( php_xmlrpc_encode($ret));
658 $o=new xmlrpc_server_methods_container;
660 "examples.getStateName" => array(
661 "function" => "findstate",
662 "signature" => $findstate_sig,
663 "docstring" => $findstate_doc
665 "examples.sortByAge" => array(
666 "function" => "agesorter",
667 "signature" => $agesorter_sig,
668 "docstring" => $agesorter_doc
670 "examples.addtwo" => array(
671 "function" => "addtwo",
672 "signature" => $addtwo_sig,
673 "docstring" => $addtwo_doc
675 "examples.addtwodouble" => array(
676 "function" => "addtwodouble",
677 "signature" => $addtwodouble_sig,
678 "docstring" => $addtwodouble_doc
680 "examples.stringecho" => array(
681 "function" => "stringecho",
682 "signature" => $stringecho_sig,
683 "docstring" => $stringecho_doc
685 "examples.echo" => array(
686 "function" => "echoback",
687 "signature" => $echoback_sig,
688 "docstring" => $echoback_doc
690 "examples.decode64" => array(
691 "function" => "echosixtyfour",
692 "signature" => $echosixtyfour_sig,
693 "docstring" => $echosixtyfour_doc
695 "examples.invertBooleans" => array(
696 "function" => "bitflipper",
697 "signature" => $bitflipper_sig,
698 "docstring" => $bitflipper_doc
700 "examples.generatePHPWarning" => array(
701 "function" => array($o, "phpwarninggenerator")
702 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
704 "examples.raiseException" => array(
705 "function" => array($o, "exceptiongenerator")
707 "examples.getallheaders" => array(
708 "function" => 'getallheaders_xmlrpc',
709 "signature" => $getallheaders_sig,
710 "docstring" => $getallheaders_doc
712 "examples.setcookies" => array(
713 "function" => 'setcookies',
714 "signature" => $setcookies_sig,
715 "docstring" => $setcookies_doc
717 "examples.getcookies" => array(
718 "function" => 'getcookies',
719 "signature" => $getcookies_sig,
720 "docstring" => $getcookies_doc
722 "mail.send" => array(
723 "function" => "mail_send",
724 "signature" => $mail_send_sig,
725 "docstring" => $mail_send_doc
727 "validator1.arrayOfStructsTest" => array(
728 "function" => "v1_arrayOfStructs",
729 "signature" => $v1_arrayOfStructs_sig,
730 "docstring" => $v1_arrayOfStructs_doc
732 "validator1.easyStructTest" => array(
733 "function" => "v1_easyStruct",
734 "signature" => $v1_easyStruct_sig,
735 "docstring" => $v1_easyStruct_doc
737 "validator1.echoStructTest" => array(
738 "function" => "v1_echoStruct",
739 "signature" => $v1_echoStruct_sig,
740 "docstring" => $v1_echoStruct_doc
742 "validator1.manyTypesTest" => array(
743 "function" => "v1_manyTypes",
744 "signature" => $v1_manyTypes_sig,
745 "docstring" => $v1_manyTypes_doc
747 "validator1.moderateSizeArrayCheck" => array(
748 "function" => "v1_moderateSizeArrayCheck",
749 "signature" => $v1_moderateSizeArrayCheck_sig,
750 "docstring" => $v1_moderateSizeArrayCheck_doc
752 "validator1.simpleStructReturnTest" => array(
753 "function" => "v1_simpleStructReturn",
754 "signature" => $v1_simpleStructReturn_sig,
755 "docstring" => $v1_simpleStructReturn_doc
757 "validator1.nestedStructTest" => array(
758 "function" => "v1_nestedStruct",
759 "signature" => $v1_nestedStruct_sig,
760 "docstring" => $v1_nestedStruct_doc
762 "validator1.countTheEntities" => array(
763 "function" => "v1_countTheEntities",
764 "signature" => $v1_countTheEntities_sig,
765 "docstring" => $v1_countTheEntities_doc
767 "interopEchoTests.echoString" => array(
768 "function" => "i_echoString",
769 "signature" => $i_echoString_sig,
770 "docstring" => $i_echoString_doc
772 "interopEchoTests.echoStringArray" => array(
773 "function" => "i_echoStringArray",
774 "signature" => $i_echoStringArray_sig,
775 "docstring" => $i_echoStringArray_doc
777 "interopEchoTests.echoInteger" => array(
778 "function" => "i_echoInteger",
779 "signature" => $i_echoInteger_sig,
780 "docstring" => $i_echoInteger_doc
782 "interopEchoTests.echoIntegerArray" => array(
783 "function" => "i_echoIntegerArray",
784 "signature" => $i_echoIntegerArray_sig,
785 "docstring" => $i_echoIntegerArray_doc
787 "interopEchoTests.echoFloat" => array(
788 "function" => "i_echoFloat",
789 "signature" => $i_echoFloat_sig,
790 "docstring" => $i_echoFloat_doc
792 "interopEchoTests.echoFloatArray" => array(
793 "function" => "i_echoFloatArray",
794 "signature" => $i_echoFloatArray_sig,
795 "docstring" => $i_echoFloatArray_doc
797 "interopEchoTests.echoStruct" => array(
798 "function" => "i_echoStruct",
799 "signature" => $i_echoStruct_sig,
800 "docstring" => $i_echoStruct_doc
802 "interopEchoTests.echoStructArray" => array(
803 "function" => "i_echoStructArray",
804 "signature" => $i_echoStructArray_sig,
805 "docstring" => $i_echoStructArray_doc
807 "interopEchoTests.echoValue" => array(
808 "function" => "i_echoValue",
809 "signature" => $i_echoValue_sig,
810 "docstring" => $i_echoValue_doc
812 "interopEchoTests.echoBase64" => array(
813 "function" => "i_echoBase64",
814 "signature" => $i_echoBase64_sig,
815 "docstring" => $i_echoBase64_doc
817 "interopEchoTests.echoDate" => array(
818 "function" => "i_echoDate",
819 "signature" => $i_echoDate_sig,
820 "docstring" => $i_echoDate_doc
822 "interopEchoTests.whichToolkit" => array(
823 "function" => "i_whichToolkit",
824 "signature" => $i_whichToolkit_sig,
825 "docstring" => $i_whichToolkit_doc
830 $a['examples.php.getStateName'] = $findstate2_sig;
833 $a['examples.php2.getStateName'] = $findstate3_sig;
836 $a['examples.php3.getStateName'] = $findstate4_sig;
839 $a['examples.php4.getStateName'] = $findstate5_sig;
841 $s=new xmlrpc_server($a, false);
843 $s->compress_response = true;
845 // out-of-band information: let the client manipulate the server operations.
846 // we do this to help the testsuite script: do not reproduce in production!
847 if (isset($_GET['RESPONSE_ENCODING']))
848 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
849 if (isset($_GET['EXCEPTION_HANDLING']))
850 $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
852 // that should do all we need!