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.
13 // give user a chance to see the source for this server instead of running the services
14 if ($_SERVER['REQUEST_METHOD'] != 'POST' && isset($_GET['showSource']))
16 highlight_file(__FILE__);
20 include_once(__DIR__."/../../vendor/autoload.php");
22 include_once(__DIR__."/../../lib/xmlrpc.inc");
23 include_once(__DIR__."/../../lib/xmlrpcs.inc");
24 include_once(__DIR__."/../../lib/xmlrpc_wrappers.inc");
27 * Used to test usage of object methods in dispatch maps and in wrapper code
29 class xmlrpc_server_methods_container
32 * Method used to test logging of php warnings generated by user functions.
34 function phpwarninggenerator($m)
36 $a = $b; // this triggers a warning in E_ALL mode, since $b is undefined
37 return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
41 * Method used to testcatching of exceptions in the server.
43 function exceptiongenerator($m)
45 throw new Exception("it's just a test", 1);
49 * a PHP version of the state-number server. Send me an integer and i'll sell you a state
53 static function findstate($s)
55 return inner_findstate($s);
61 // of the state-number server
62 // send me an integer and i'll sell you a state
65 "Alabama", "Alaska", "Arizona", "Arkansas", "California",
66 "Colorado", "Columbia", "Connecticut", "Delaware", "Florida",
67 "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
68 "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
69 "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
70 "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina",
71 "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
72 "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
73 "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"
76 $findstate_sig=array(array($xmlrpcString, $xmlrpcInt));
77 $findstate_doc='When passed an integer between 1 and 51 returns the
78 name of a US state, where the integer is the index of that state name
79 in an alphabetic order.';
82 function findstate($m)
84 global $xmlrpcerruser, $stateNames;
86 // get the first param
89 // param must be there and of the correct type: server object does the
92 // extract the value of the state number
93 $snv=$sno->scalarval();
94 // look it up in our array (zero-based)
95 if (isset($stateNames[$snv-1]))
97 $sname=$stateNames[$snv-1];
101 // not, there so complain
102 $err="I don't have a state for the index '" . $snv . "'";
105 // if we generated an error, create an error return response
108 return new xmlrpcresp(0, $xmlrpcerruser, $err);
112 // otherwise, we create the right response
113 // with the state name
114 return new xmlrpcresp(new xmlrpcval($sname));
119 * Inner code of the state-number server.
120 * Used to test auto-registration of PHP funcions as xmlrpc methods.
121 * @param integer $stateno the state number
122 * @return string the name of the state (or error descrption)
124 function inner_findstate($stateno)
127 if (isset($stateNames[$stateno-1]))
129 return $stateNames[$stateno-1];
133 // not, there so complain
134 return "I don't have a state for the index '" . $stateno . "'";
137 $findstate2_sig = wrap_php_function('inner_findstate');
139 $findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
141 $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
143 $obj = new xmlrpc_server_methods_container();
144 $findstate4_sig = wrap_php_function(array($obj, 'findstate'));
146 $addtwo_sig=array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
147 $addtwo_doc='Add two integers together and return the result';
152 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"int"));
155 $addtwodouble_sig=array(array($xmlrpcDouble, $xmlrpcDouble, $xmlrpcDouble));
156 $addtwodouble_doc='Add two doubles together and return the result';
157 function addtwodouble($m)
161 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"double"));
164 $stringecho_sig=array(array($xmlrpcString, $xmlrpcString));
165 $stringecho_doc='Accepts a string parameter, returns the string.';
166 function stringecho($m)
168 // just sends back a string
170 $v = $s->scalarval();
171 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
174 $echoback_sig=array(array($xmlrpcString, $xmlrpcString));
175 $echoback_doc='Accepts a string parameter, returns the entire incoming payload';
176 function echoback($m)
178 // just sends back a string with what i got
179 // sent to me, just escaped, that's all
181 // $m is an incoming message
182 $s="I got the following message:\n" . $m->serialize();
183 return new xmlrpcresp(new xmlrpcval($s));
186 $echosixtyfour_sig=array(array($xmlrpcString, $xmlrpcBase64));
187 $echosixtyfour_doc='Accepts a base64 parameter and returns it decoded as a string';
188 function echosixtyfour($m)
190 // accepts an encoded value, but sends it back
191 // as a normal string. this is to test base64 encoding
192 // is working as expected
193 $incoming=$m->getParam(0);
194 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
197 $bitflipper_sig=array(array($xmlrpcArray, $xmlrpcArray));
198 $bitflipper_doc='Accepts an array of booleans, and returns them inverted';
199 function bitflipper($m)
205 $rv=new xmlrpcval(array(), $xmlrpcArray);
207 for($j=0; $j<$sz; $j++)
212 $rv->addScalar(false, "boolean");
216 $rv->addScalar(true, "boolean");
220 return new xmlrpcresp($rv);
225 // send me an array of structs thus:
232 // and I'll return it to you in sorted order
234 function agesorter_compare($a, $b)
236 global $agesorter_arr;
238 // don't even ask me _why_ these come padded with
239 // hyphens, I couldn't tell you :p
240 $a=str_replace("-", "", $a);
241 $b=str_replace("-", "", $b);
243 if ($agesorter_arr[$a]==$agesorter_arr[$b])
247 return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
250 $agesorter_sig=array(array($xmlrpcArray, $xmlrpcArray));
251 $agesorter_doc='Send this method an array of [string, int] structs, eg:
258 And the array will be returned with the entries sorted by their numbers.
260 function agesorter($m)
262 global $agesorter_arr, $xmlrpcerruser, $s;
264 xmlrpc_debugmsg("Entering 'agesorter'");
266 $sno=$m->getParam(0);
267 // error string for [if|when] things go wrong
269 // create the output value
273 if (isset($sno) && $sno->kindOf()=="array")
275 $max=$sno->arraysize();
276 // TODO: create debug method to print can work once more
277 // print "<!-- found $max array elements -->\n";
278 for($i=0; $i<$max; $i++)
280 $rec=$sno->arraymem($i);
281 if ($rec->kindOf()!="struct")
283 $err="Found non-struct in array at element $i";
286 // extract name and age from struct
287 $n=$rec->structmem("name");
288 $a=$rec->structmem("age");
289 // $n and $a are xmlrpcvals,
290 // so get the scalarval from them
291 $agar[$n->scalarval()]=$a->scalarval();
294 $agesorter_arr=$agar;
295 // hack, must make global as uksort() won't
296 // allow us to pass any other auxilliary information
297 uksort($agesorter_arr, agesorter_compare);
299 while (list( $key, $val ) = each( $agesorter_arr ) )
301 // recreate each struct element
302 $outAr[]=new xmlrpcval(array("name" =>
305 new xmlrpcval($val, "int")), "struct");
307 // add this array to the output value
308 $v->addArray($outAr);
312 $err="Must be one parameter, an array of structs";
317 return new xmlrpcresp(0, $xmlrpcerruser, $err);
321 return new xmlrpcresp($v);
325 // signature and instructions, place these in the dispatch
327 $mail_send_sig=array(array(
328 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
329 $xmlrpcString, $xmlrpcString, $xmlrpcString,
330 $xmlrpcString, $xmlrpcString
333 $mail_send_doc='mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
334 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
335 subject is a string, the subject of the message.<br/>
336 sender is a string, it\'s the email address of the person sending the message. This string can not be
337 a comma-separated list, it must contain a single email address only.<br/>
338 text is a string, it contains the body of the message.<br/>
339 mimetype, a string, is a standard MIME type, for example, text/plain.
341 // WARNING; this functionality depends on the sendmail -t option
342 // it may not work with Windows machines properly; particularly
343 // the Bcc option. Sneak on your friends at your own risk!
344 function mail_send($m)
346 global $xmlrpcerruser, $xmlrpcBoolean;
349 $mTo=$m->getParam(0);
350 $mSub=$m->getParam(1);
351 $mBody=$m->getParam(2);
352 $mFrom=$m->getParam(3);
353 $mCc=$m->getParam(4);
354 $mBcc=$m->getParam(5);
355 $mMime=$m->getParam(6);
357 if ($mTo->scalarval()=="")
359 $err="Error, no 'To' field specified";
362 if ($mFrom->scalarval()=="")
364 $err="Error, no 'From' field specified";
367 $msghdr="From: " . $mFrom->scalarval() . "\n";
368 $msghdr.="To: ". $mTo->scalarval() . "\n";
370 if ($mCc->scalarval()!="")
372 $msghdr.="Cc: " . $mCc->scalarval(). "\n";
374 if ($mBcc->scalarval()!="")
376 $msghdr.="Bcc: " . $mBcc->scalarval(). "\n";
378 if ($mMime->scalarval()!="")
380 $msghdr.="Content-type: " . $mMime->scalarval() . "\n";
382 $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0";
391 $err="Error, could not send the mail.";
397 return new xmlrpcresp(0, $xmlrpcerruser, $err);
401 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
405 $getallheaders_sig=array(array($xmlrpcStruct));
406 $getallheaders_doc='Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
407 function getallheaders_xmlrpc($m)
409 global $xmlrpcerruser;
410 if (function_exists('getallheaders'))
412 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
417 // IIS: poor man's version of getallheaders
418 foreach ($_SERVER as $key => $val)
419 if (strpos($key, 'HTTP_') === 0)
421 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
422 $headers[$key] = $val;
424 return new xmlrpcresp(php_xmlrpc_encode($headers));
428 $setcookies_sig=array(array($xmlrpcInt, $xmlrpcStruct));
429 $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)';
430 function setcookies($m)
432 $m = $m->getParam(0);
433 while(list($name,$value) = $m->structeach())
435 $cookiedesc = php_xmlrpc_decode($value);
436 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
438 return new xmlrpcresp(new xmlrpcval(1, 'int'));
441 $getcookies_sig=array(array($xmlrpcStruct));
442 $getcookies_doc='Sends to client a response containing all http cookies as received in the request (as struct)';
443 function getcookies($m)
445 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
448 $v1_arrayOfStructs_sig=array(array($xmlrpcInt, $xmlrpcArray));
449 $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.';
450 function v1_arrayOfStructs($m)
452 $sno=$m->getParam(0);
454 for($i=0; $i<$sno->arraysize(); $i++)
456 $str=$sno->arraymem($i);
458 while(list($key,$val)=$str->structeach())
462 $numcurly+=$val->scalarval();
466 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
469 $v1_easyStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
470 $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.';
471 function v1_easyStruct($m)
473 $sno=$m->getParam(0);
474 $moe=$sno->structmem("moe");
475 $larry=$sno->structmem("larry");
476 $curly=$sno->structmem("curly");
477 $num=$moe->scalarval() + $larry->scalarval() + $curly->scalarval();
478 return new xmlrpcresp(new xmlrpcval($num, "int"));
481 $v1_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
482 $v1_echoStruct_doc='This handler takes a single parameter, a struct. Your handler must return the struct.';
483 function v1_echoStruct($m)
485 $sno=$m->getParam(0);
486 return new xmlrpcresp($sno);
489 $v1_manyTypes_sig=array(array(
490 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
491 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
494 $v1_manyTypes_doc='This handler takes six parameters, and returns an array containing all the parameters.';
495 function v1_manyTypes($m)
497 return new xmlrpcresp(new xmlrpcval(array(
508 $v1_moderateSizeArrayCheck_sig=array(array($xmlrpcString, $xmlrpcArray));
509 $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.';
510 function v1_moderateSizeArrayCheck($m)
513 $sz=$ar->arraysize();
514 $first=$ar->arraymem(0);
515 $last=$ar->arraymem($sz-1);
516 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
517 $last->scalarval(), "string"));
520 $v1_simpleStructReturn_sig=array(array($xmlrpcStruct, $xmlrpcInt));
521 $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.';
522 function v1_simpleStructReturn($m)
524 $sno=$m->getParam(0);
525 $v=$sno->scalarval();
526 return new xmlrpcresp(new xmlrpcval(array(
527 "times10" => new xmlrpcval($v*10, "int"),
528 "times100" => new xmlrpcval($v*100, "int"),
529 "times1000" => new xmlrpcval($v*1000, "int")),
534 $v1_nestedStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
535 $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.';
536 function v1_nestedStruct($m)
538 $sno=$m->getParam(0);
540 $twoK=$sno->structmem("2000");
541 $april=$twoK->structmem("04");
542 $fools=$april->structmem("01");
543 $curly=$fools->structmem("curly");
544 $larry=$fools->structmem("larry");
545 $moe=$fools->structmem("moe");
546 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
549 $v1_countTheEntities_sig=array(array($xmlrpcStruct, $xmlrpcString));
550 $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.';
551 function v1_countTheEntities($m)
553 $sno=$m->getParam(0);
554 $str=$sno->scalarval();
555 $gt=0; $lt=0; $ap=0; $qu=0; $amp=0;
556 for($i=0; $i<strlen($str); $i++)
558 $c=substr($str, $i, 1);
580 return new xmlrpcresp(new xmlrpcval(array(
581 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
582 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
583 "ctAmpersands" => new xmlrpcval($amp, "int"),
584 "ctApostrophes" => new xmlrpcval($ap, "int"),
585 "ctQuotes" => new xmlrpcval($qu, "int")),
590 // trivial interop tests
591 // http://www.xmlrpc.com/stories/storyReader$1636
593 $i_echoString_sig=array(array($xmlrpcString, $xmlrpcString));
594 $i_echoString_doc="Echoes string.";
596 $i_echoStringArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
597 $i_echoStringArray_doc="Echoes string array.";
599 $i_echoInteger_sig=array(array($xmlrpcInt, $xmlrpcInt));
600 $i_echoInteger_doc="Echoes integer.";
602 $i_echoIntegerArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
603 $i_echoIntegerArray_doc="Echoes integer array.";
605 $i_echoFloat_sig=array(array($xmlrpcDouble, $xmlrpcDouble));
606 $i_echoFloat_doc="Echoes float.";
608 $i_echoFloatArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
609 $i_echoFloatArray_doc="Echoes float array.";
611 $i_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
612 $i_echoStruct_doc="Echoes struct.";
614 $i_echoStructArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
615 $i_echoStructArray_doc="Echoes struct array.";
617 $i_echoValue_doc="Echoes any value back.";
618 $i_echoValue_sig=array(array($xmlrpcValue, $xmlrpcValue));
620 $i_echoBase64_sig=array(array($xmlrpcBase64, $xmlrpcBase64));
621 $i_echoBase64_doc="Echoes base64.";
623 $i_echoDate_sig=array(array($xmlrpcDateTime, $xmlrpcDateTime));
624 $i_echoDate_doc="Echoes dateTime.";
626 function i_echoParam($m)
629 return new xmlrpcresp($s);
632 function i_echoString($m) { return i_echoParam($m); }
633 function i_echoInteger($m) { return i_echoParam($m); }
634 function i_echoFloat($m) { return i_echoParam($m); }
635 function i_echoStruct($m) { return i_echoParam($m); }
636 function i_echoStringArray($m) { return i_echoParam($m); }
637 function i_echoIntegerArray($m) { return i_echoParam($m); }
638 function i_echoFloatArray($m) { return i_echoParam($m); }
639 function i_echoStructArray($m) { return i_echoParam($m); }
640 function i_echoValue($m) { return i_echoParam($m); }
641 function i_echoBase64($m) { return i_echoParam($m); }
642 function i_echoDate($m) { return i_echoParam($m); }
644 $i_whichToolkit_sig=array(array($xmlrpcStruct));
645 $i_whichToolkit_doc="Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
647 function i_whichToolkit($m)
649 global $xmlrpcName, $xmlrpcVersion,$SERVER_SOFTWARE;
651 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
652 "toolkitName" => $xmlrpcName,
653 "toolkitVersion" => $xmlrpcVersion,
654 "toolkitOperatingSystem" => isset ($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']
656 return new xmlrpcresp ( php_xmlrpc_encode($ret));
659 $o=new xmlrpc_server_methods_container;
661 "examples.getStateName" => array(
662 "function" => "findstate",
663 "signature" => $findstate_sig,
664 "docstring" => $findstate_doc
666 "examples.sortByAge" => array(
667 "function" => "agesorter",
668 "signature" => $agesorter_sig,
669 "docstring" => $agesorter_doc
671 "examples.addtwo" => array(
672 "function" => "addtwo",
673 "signature" => $addtwo_sig,
674 "docstring" => $addtwo_doc
676 "examples.addtwodouble" => array(
677 "function" => "addtwodouble",
678 "signature" => $addtwodouble_sig,
679 "docstring" => $addtwodouble_doc
681 "examples.stringecho" => array(
682 "function" => "stringecho",
683 "signature" => $stringecho_sig,
684 "docstring" => $stringecho_doc
686 "examples.echo" => array(
687 "function" => "echoback",
688 "signature" => $echoback_sig,
689 "docstring" => $echoback_doc
691 "examples.decode64" => array(
692 "function" => "echosixtyfour",
693 "signature" => $echosixtyfour_sig,
694 "docstring" => $echosixtyfour_doc
696 "examples.invertBooleans" => array(
697 "function" => "bitflipper",
698 "signature" => $bitflipper_sig,
699 "docstring" => $bitflipper_doc
701 "examples.generatePHPWarning" => array(
702 "function" => array($o, "phpwarninggenerator")
703 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
705 "examples.raiseException" => array(
706 "function" => array($o, "exceptiongenerator")
708 "examples.getallheaders" => array(
709 "function" => 'getallheaders_xmlrpc',
710 "signature" => $getallheaders_sig,
711 "docstring" => $getallheaders_doc
713 "examples.setcookies" => array(
714 "function" => 'setcookies',
715 "signature" => $setcookies_sig,
716 "docstring" => $setcookies_doc
718 "examples.getcookies" => array(
719 "function" => 'getcookies',
720 "signature" => $getcookies_sig,
721 "docstring" => $getcookies_doc
723 "mail.send" => array(
724 "function" => "mail_send",
725 "signature" => $mail_send_sig,
726 "docstring" => $mail_send_doc
728 "validator1.arrayOfStructsTest" => array(
729 "function" => "v1_arrayOfStructs",
730 "signature" => $v1_arrayOfStructs_sig,
731 "docstring" => $v1_arrayOfStructs_doc
733 "validator1.easyStructTest" => array(
734 "function" => "v1_easyStruct",
735 "signature" => $v1_easyStruct_sig,
736 "docstring" => $v1_easyStruct_doc
738 "validator1.echoStructTest" => array(
739 "function" => "v1_echoStruct",
740 "signature" => $v1_echoStruct_sig,
741 "docstring" => $v1_echoStruct_doc
743 "validator1.manyTypesTest" => array(
744 "function" => "v1_manyTypes",
745 "signature" => $v1_manyTypes_sig,
746 "docstring" => $v1_manyTypes_doc
748 "validator1.moderateSizeArrayCheck" => array(
749 "function" => "v1_moderateSizeArrayCheck",
750 "signature" => $v1_moderateSizeArrayCheck_sig,
751 "docstring" => $v1_moderateSizeArrayCheck_doc
753 "validator1.simpleStructReturnTest" => array(
754 "function" => "v1_simpleStructReturn",
755 "signature" => $v1_simpleStructReturn_sig,
756 "docstring" => $v1_simpleStructReturn_doc
758 "validator1.nestedStructTest" => array(
759 "function" => "v1_nestedStruct",
760 "signature" => $v1_nestedStruct_sig,
761 "docstring" => $v1_nestedStruct_doc
763 "validator1.countTheEntities" => array(
764 "function" => "v1_countTheEntities",
765 "signature" => $v1_countTheEntities_sig,
766 "docstring" => $v1_countTheEntities_doc
768 "interopEchoTests.echoString" => array(
769 "function" => "i_echoString",
770 "signature" => $i_echoString_sig,
771 "docstring" => $i_echoString_doc
773 "interopEchoTests.echoStringArray" => array(
774 "function" => "i_echoStringArray",
775 "signature" => $i_echoStringArray_sig,
776 "docstring" => $i_echoStringArray_doc
778 "interopEchoTests.echoInteger" => array(
779 "function" => "i_echoInteger",
780 "signature" => $i_echoInteger_sig,
781 "docstring" => $i_echoInteger_doc
783 "interopEchoTests.echoIntegerArray" => array(
784 "function" => "i_echoIntegerArray",
785 "signature" => $i_echoIntegerArray_sig,
786 "docstring" => $i_echoIntegerArray_doc
788 "interopEchoTests.echoFloat" => array(
789 "function" => "i_echoFloat",
790 "signature" => $i_echoFloat_sig,
791 "docstring" => $i_echoFloat_doc
793 "interopEchoTests.echoFloatArray" => array(
794 "function" => "i_echoFloatArray",
795 "signature" => $i_echoFloatArray_sig,
796 "docstring" => $i_echoFloatArray_doc
798 "interopEchoTests.echoStruct" => array(
799 "function" => "i_echoStruct",
800 "signature" => $i_echoStruct_sig,
801 "docstring" => $i_echoStruct_doc
803 "interopEchoTests.echoStructArray" => array(
804 "function" => "i_echoStructArray",
805 "signature" => $i_echoStructArray_sig,
806 "docstring" => $i_echoStructArray_doc
808 "interopEchoTests.echoValue" => array(
809 "function" => "i_echoValue",
810 "signature" => $i_echoValue_sig,
811 "docstring" => $i_echoValue_doc
813 "interopEchoTests.echoBase64" => array(
814 "function" => "i_echoBase64",
815 "signature" => $i_echoBase64_sig,
816 "docstring" => $i_echoBase64_doc
818 "interopEchoTests.echoDate" => array(
819 "function" => "i_echoDate",
820 "signature" => $i_echoDate_sig,
821 "docstring" => $i_echoDate_doc
823 "interopEchoTests.whichToolkit" => array(
824 "function" => "i_whichToolkit",
825 "signature" => $i_whichToolkit_sig,
826 "docstring" => $i_whichToolkit_doc
831 $a['examples.php.getStateName'] = $findstate2_sig;
834 $a['examples.php2.getStateName'] = $findstate3_sig;
837 $a['examples.php3.getStateName'] = $findstate4_sig;
840 $a['examples.php4.getStateName'] = $findstate5_sig;
842 $s=new xmlrpc_server($a, false);
844 $s->compress_response = true;
846 // out-of-band information: let the client manipulate the server operations.
847 // we do this to help the testsuite script: do not reproduce in production!
848 if (isset($_GET['RESPONSE_ENCODING']))
849 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
850 if (isset($_GET['EXCEPTION_HANDLING']))
851 $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
853 // that should do all we need!