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 * a PHP version of the state-number server. Send me an integer and i'll sell you a state
44 static function findstate($s)
46 return inner_findstate($s);
52 // of the state-number server
53 // send me an integer and i'll sell you a state
56 "Alabama", "Alaska", "Arizona", "Arkansas", "California",
57 "Colorado", "Columbia", "Connecticut", "Delaware", "Florida",
58 "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
59 "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
60 "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
61 "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina",
62 "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
63 "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
64 "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"
67 $findstate_sig=array(array($xmlrpcString, $xmlrpcInt));
68 $findstate_doc='When passed an integer between 1 and 51 returns the
69 name of a US state, where the integer is the index of that state name
70 in an alphabetic order.';
73 function findstate($m)
75 global $xmlrpcerruser, $stateNames;
77 // get the first param
80 // param must be there and of the correct type: server object does the
83 // extract the value of the state number
84 $snv=$sno->scalarval();
85 // look it up in our array (zero-based)
86 if (isset($stateNames[$snv-1]))
88 $sname=$stateNames[$snv-1];
92 // not, there so complain
93 $err="I don't have a state for the index '" . $snv . "'";
96 // if we generated an error, create an error return response
99 return new xmlrpcresp(0, $xmlrpcerruser, $err);
103 // otherwise, we create the right response
104 // with the state name
105 return new xmlrpcresp(new xmlrpcval($sname));
110 * Inner code of the state-number server.
111 * Used to test auto-registration of PHP funcions as xmlrpc methods.
112 * @param integer $stateno the state number
113 * @return string the name of the state (or error descrption)
115 function inner_findstate($stateno)
118 if (isset($stateNames[$stateno-1]))
120 return $stateNames[$stateno-1];
124 // not, there so complain
125 return "I don't have a state for the index '" . $stateno . "'";
128 $findstate2_sig = wrap_php_function('inner_findstate');
130 $findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
132 $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
134 $obj = new xmlrpc_server_methods_container();
135 $findstate4_sig = wrap_php_function(array($obj, 'findstate'));
137 $addtwo_sig=array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
138 $addtwo_doc='Add two integers together and return the result';
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)
152 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"double"));
155 $stringecho_sig=array(array($xmlrpcString, $xmlrpcString));
156 $stringecho_doc='Accepts a string parameter, returns the string.';
157 function stringecho($m)
159 // just sends back a string
161 $v = $s->scalarval();
162 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
165 $echoback_sig=array(array($xmlrpcString, $xmlrpcString));
166 $echoback_doc='Accepts a string parameter, returns the entire incoming payload';
167 function echoback($m)
169 // just sends back a string with what i got
170 // sent to me, just escaped, that's all
172 // $m is an incoming message
173 $s="I got the following message:\n" . $m->serialize();
174 return new xmlrpcresp(new xmlrpcval($s));
177 $echosixtyfour_sig=array(array($xmlrpcString, $xmlrpcBase64));
178 $echosixtyfour_doc='Accepts a base64 parameter and returns it decoded as a string';
179 function echosixtyfour($m)
181 // accepts an encoded value, but sends it back
182 // as a normal string. this is to test base64 encoding
183 // is working as expected
184 $incoming=$m->getParam(0);
185 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
188 $bitflipper_sig=array(array($xmlrpcArray, $xmlrpcArray));
189 $bitflipper_doc='Accepts an array of booleans, and returns them inverted';
190 function bitflipper($m)
196 $rv=new xmlrpcval(array(), $xmlrpcArray);
198 for($j=0; $j<$sz; $j++)
203 $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[$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
264 if (isset($sno) && $sno->kindOf()=="array")
266 $max=$sno->arraysize();
267 // TODO: create debug method to print can work once more
268 // print "<!-- found $max array elements -->\n";
269 for($i=0; $i<$max; $i++)
271 $rec=$sno->arraymem($i);
272 if ($rec->kindOf()!="struct")
274 $err="Found non-struct in array at element $i";
277 // extract name and age from struct
278 $n=$rec->structmem("name");
279 $a=$rec->structmem("age");
280 // $n and $a are xmlrpcvals,
281 // so get the scalarval from them
282 $agar[$n->scalarval()]=$a->scalarval();
285 $agesorter_arr=$agar;
286 // hack, must make global as uksort() won't
287 // allow us to pass any other auxilliary information
288 uksort($agesorter_arr, agesorter_compare);
290 while (list( $key, $val ) = each( $agesorter_arr ) )
292 // recreate each struct element
293 $outAr[]=new xmlrpcval(array("name" =>
296 new xmlrpcval($val, "int")), "struct");
298 // add this array to the output value
299 $v->addArray($outAr);
303 $err="Must be one parameter, an array of structs";
308 return new xmlrpcresp(0, $xmlrpcerruser, $err);
312 return new xmlrpcresp($v);
316 // signature and instructions, place these in the dispatch
318 $mail_send_sig=array(array(
319 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
320 $xmlrpcString, $xmlrpcString, $xmlrpcString,
321 $xmlrpcString, $xmlrpcString
324 $mail_send_doc='mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
325 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
326 subject is a string, the subject of the message.<br/>
327 sender is a string, it\'s the email address of the person sending the message. This string can not be
328 a comma-separated list, it must contain a single email address only.<br/>
329 text is a string, it contains the body of the message.<br/>
330 mimetype, a string, is a standard MIME type, for example, text/plain.
332 // WARNING; this functionality depends on the sendmail -t option
333 // it may not work with Windows machines properly; particularly
334 // the Bcc option. Sneak on your friends at your own risk!
335 function mail_send($m)
337 global $xmlrpcerruser, $xmlrpcBoolean;
340 $mTo=$m->getParam(0);
341 $mSub=$m->getParam(1);
342 $mBody=$m->getParam(2);
343 $mFrom=$m->getParam(3);
344 $mCc=$m->getParam(4);
345 $mBcc=$m->getParam(5);
346 $mMime=$m->getParam(6);
348 if ($mTo->scalarval()=="")
350 $err="Error, no 'To' field specified";
353 if ($mFrom->scalarval()=="")
355 $err="Error, no 'From' field specified";
358 $msghdr="From: " . $mFrom->scalarval() . "\n";
359 $msghdr.="To: ". $mTo->scalarval() . "\n";
361 if ($mCc->scalarval()!="")
363 $msghdr.="Cc: " . $mCc->scalarval(). "\n";
365 if ($mBcc->scalarval()!="")
367 $msghdr.="Bcc: " . $mBcc->scalarval(). "\n";
369 if ($mMime->scalarval()!="")
371 $msghdr.="Content-type: " . $mMime->scalarval() . "\n";
373 $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0";
382 $err="Error, could not send the mail.";
388 return new xmlrpcresp(0, $xmlrpcerruser, $err);
392 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
396 $getallheaders_sig=array(array($xmlrpcStruct));
397 $getallheaders_doc='Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
398 function getallheaders_xmlrpc($m)
400 global $xmlrpcerruser;
401 if (function_exists('getallheaders'))
403 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
408 // IIS: poor man's version of getallheaders
409 foreach ($_SERVER as $key => $val)
410 if (strpos($key, 'HTTP_') === 0)
412 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
413 $headers[$key] = $val;
415 return new xmlrpcresp(php_xmlrpc_encode($headers));
419 $setcookies_sig=array(array($xmlrpcInt, $xmlrpcStruct));
420 $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)';
421 function setcookies($m)
423 $m = $m->getParam(0);
424 while(list($name,$value) = $m->structeach())
426 $cookiedesc = php_xmlrpc_decode($value);
427 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
429 return new xmlrpcresp(new xmlrpcval(1, 'int'));
432 $getcookies_sig=array(array($xmlrpcStruct));
433 $getcookies_doc='Sends to client a response containing all http cookies as received in the request (as struct)';
434 function getcookies($m)
436 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
439 $v1_arrayOfStructs_sig=array(array($xmlrpcInt, $xmlrpcArray));
440 $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.';
441 function v1_arrayOfStructs($m)
443 $sno=$m->getParam(0);
445 for($i=0; $i<$sno->arraysize(); $i++)
447 $str=$sno->arraymem($i);
449 while(list($key,$val)=$str->structeach())
453 $numcurly+=$val->scalarval();
457 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
460 $v1_easyStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
461 $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.';
462 function v1_easyStruct($m)
464 $sno=$m->getParam(0);
465 $moe=$sno->structmem("moe");
466 $larry=$sno->structmem("larry");
467 $curly=$sno->structmem("curly");
468 $num=$moe->scalarval() + $larry->scalarval() + $curly->scalarval();
469 return new xmlrpcresp(new xmlrpcval($num, "int"));
472 $v1_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
473 $v1_echoStruct_doc='This handler takes a single parameter, a struct. Your handler must return the struct.';
474 function v1_echoStruct($m)
476 $sno=$m->getParam(0);
477 return new xmlrpcresp($sno);
480 $v1_manyTypes_sig=array(array(
481 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
482 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
485 $v1_manyTypes_doc='This handler takes six parameters, and returns an array containing all the parameters.';
486 function v1_manyTypes($m)
488 return new xmlrpcresp(new xmlrpcval(array(
499 $v1_moderateSizeArrayCheck_sig=array(array($xmlrpcString, $xmlrpcArray));
500 $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.';
501 function v1_moderateSizeArrayCheck($m)
504 $sz=$ar->arraysize();
505 $first=$ar->arraymem(0);
506 $last=$ar->arraymem($sz-1);
507 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
508 $last->scalarval(), "string"));
511 $v1_simpleStructReturn_sig=array(array($xmlrpcStruct, $xmlrpcInt));
512 $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.';
513 function v1_simpleStructReturn($m)
515 $sno=$m->getParam(0);
516 $v=$sno->scalarval();
517 return new xmlrpcresp(new xmlrpcval(array(
518 "times10" => new xmlrpcval($v*10, "int"),
519 "times100" => new xmlrpcval($v*100, "int"),
520 "times1000" => new xmlrpcval($v*1000, "int")),
525 $v1_nestedStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
526 $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.';
527 function v1_nestedStruct($m)
529 $sno=$m->getParam(0);
531 $twoK=$sno->structmem("2000");
532 $april=$twoK->structmem("04");
533 $fools=$april->structmem("01");
534 $curly=$fools->structmem("curly");
535 $larry=$fools->structmem("larry");
536 $moe=$fools->structmem("moe");
537 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
540 $v1_countTheEntities_sig=array(array($xmlrpcStruct, $xmlrpcString));
541 $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.';
542 function v1_countTheEntities($m)
544 $sno=$m->getParam(0);
545 $str=$sno->scalarval();
546 $gt=0; $lt=0; $ap=0; $qu=0; $amp=0;
547 for($i=0; $i<strlen($str); $i++)
549 $c=substr($str, $i, 1);
571 return new xmlrpcresp(new xmlrpcval(array(
572 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
573 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
574 "ctAmpersands" => new xmlrpcval($amp, "int"),
575 "ctApostrophes" => new xmlrpcval($ap, "int"),
576 "ctQuotes" => new xmlrpcval($qu, "int")),
581 // trivial interop tests
582 // http://www.xmlrpc.com/stories/storyReader$1636
584 $i_echoString_sig=array(array($xmlrpcString, $xmlrpcString));
585 $i_echoString_doc="Echoes string.";
587 $i_echoStringArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
588 $i_echoStringArray_doc="Echoes string array.";
590 $i_echoInteger_sig=array(array($xmlrpcInt, $xmlrpcInt));
591 $i_echoInteger_doc="Echoes integer.";
593 $i_echoIntegerArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
594 $i_echoIntegerArray_doc="Echoes integer array.";
596 $i_echoFloat_sig=array(array($xmlrpcDouble, $xmlrpcDouble));
597 $i_echoFloat_doc="Echoes float.";
599 $i_echoFloatArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
600 $i_echoFloatArray_doc="Echoes float array.";
602 $i_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
603 $i_echoStruct_doc="Echoes struct.";
605 $i_echoStructArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
606 $i_echoStructArray_doc="Echoes struct array.";
608 $i_echoValue_doc="Echoes any value back.";
609 $i_echoValue_sig=array(array($xmlrpcValue, $xmlrpcValue));
611 $i_echoBase64_sig=array(array($xmlrpcBase64, $xmlrpcBase64));
612 $i_echoBase64_doc="Echoes base64.";
614 $i_echoDate_sig=array(array($xmlrpcDateTime, $xmlrpcDateTime));
615 $i_echoDate_doc="Echoes dateTime.";
617 function i_echoParam($m)
620 return new xmlrpcresp($s);
623 function i_echoString($m) { return i_echoParam($m); }
624 function i_echoInteger($m) { return i_echoParam($m); }
625 function i_echoFloat($m) { return i_echoParam($m); }
626 function i_echoStruct($m) { return i_echoParam($m); }
627 function i_echoStringArray($m) { return i_echoParam($m); }
628 function i_echoIntegerArray($m) { return i_echoParam($m); }
629 function i_echoFloatArray($m) { return i_echoParam($m); }
630 function i_echoStructArray($m) { return i_echoParam($m); }
631 function i_echoValue($m) { return i_echoParam($m); }
632 function i_echoBase64($m) { return i_echoParam($m); }
633 function i_echoDate($m) { return i_echoParam($m); }
635 $i_whichToolkit_sig=array(array($xmlrpcStruct));
636 $i_whichToolkit_doc="Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
638 function i_whichToolkit($m)
640 global $xmlrpcName, $xmlrpcVersion,$SERVER_SOFTWARE;
642 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
643 "toolkitName" => $xmlrpcName,
644 "toolkitVersion" => $xmlrpcVersion,
645 "toolkitOperatingSystem" => isset ($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']
647 return new xmlrpcresp ( php_xmlrpc_encode($ret));
650 $o=new xmlrpc_server_methods_container;
652 "examples.getStateName" => array(
653 "function" => "findstate",
654 "signature" => $findstate_sig,
655 "docstring" => $findstate_doc
657 "examples.sortByAge" => array(
658 "function" => "agesorter",
659 "signature" => $agesorter_sig,
660 "docstring" => $agesorter_doc
662 "examples.addtwo" => array(
663 "function" => "addtwo",
664 "signature" => $addtwo_sig,
665 "docstring" => $addtwo_doc
667 "examples.addtwodouble" => array(
668 "function" => "addtwodouble",
669 "signature" => $addtwodouble_sig,
670 "docstring" => $addtwodouble_doc
672 "examples.stringecho" => array(
673 "function" => "stringecho",
674 "signature" => $stringecho_sig,
675 "docstring" => $stringecho_doc
677 "examples.echo" => array(
678 "function" => "echoback",
679 "signature" => $echoback_sig,
680 "docstring" => $echoback_doc
682 "examples.decode64" => array(
683 "function" => "echosixtyfour",
684 "signature" => $echosixtyfour_sig,
685 "docstring" => $echosixtyfour_doc
687 "examples.invertBooleans" => array(
688 "function" => "bitflipper",
689 "signature" => $bitflipper_sig,
690 "docstring" => $bitflipper_doc
692 "examples.generatePHPWarning" => array(
693 "function" => array($o, "phpwarninggenerator")
694 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
696 "examples.getallheaders" => array(
697 "function" => 'getallheaders_xmlrpc',
698 "signature" => $getallheaders_sig,
699 "docstring" => $getallheaders_doc
701 "examples.setcookies" => array(
702 "function" => 'setcookies',
703 "signature" => $setcookies_sig,
704 "docstring" => $setcookies_doc
706 "examples.getcookies" => array(
707 "function" => 'getcookies',
708 "signature" => $getcookies_sig,
709 "docstring" => $getcookies_doc
711 "mail.send" => array(
712 "function" => "mail_send",
713 "signature" => $mail_send_sig,
714 "docstring" => $mail_send_doc
716 "validator1.arrayOfStructsTest" => array(
717 "function" => "v1_arrayOfStructs",
718 "signature" => $v1_arrayOfStructs_sig,
719 "docstring" => $v1_arrayOfStructs_doc
721 "validator1.easyStructTest" => array(
722 "function" => "v1_easyStruct",
723 "signature" => $v1_easyStruct_sig,
724 "docstring" => $v1_easyStruct_doc
726 "validator1.echoStructTest" => array(
727 "function" => "v1_echoStruct",
728 "signature" => $v1_echoStruct_sig,
729 "docstring" => $v1_echoStruct_doc
731 "validator1.manyTypesTest" => array(
732 "function" => "v1_manyTypes",
733 "signature" => $v1_manyTypes_sig,
734 "docstring" => $v1_manyTypes_doc
736 "validator1.moderateSizeArrayCheck" => array(
737 "function" => "v1_moderateSizeArrayCheck",
738 "signature" => $v1_moderateSizeArrayCheck_sig,
739 "docstring" => $v1_moderateSizeArrayCheck_doc
741 "validator1.simpleStructReturnTest" => array(
742 "function" => "v1_simpleStructReturn",
743 "signature" => $v1_simpleStructReturn_sig,
744 "docstring" => $v1_simpleStructReturn_doc
746 "validator1.nestedStructTest" => array(
747 "function" => "v1_nestedStruct",
748 "signature" => $v1_nestedStruct_sig,
749 "docstring" => $v1_nestedStruct_doc
751 "validator1.countTheEntities" => array(
752 "function" => "v1_countTheEntities",
753 "signature" => $v1_countTheEntities_sig,
754 "docstring" => $v1_countTheEntities_doc
756 "interopEchoTests.echoString" => array(
757 "function" => "i_echoString",
758 "signature" => $i_echoString_sig,
759 "docstring" => $i_echoString_doc
761 "interopEchoTests.echoStringArray" => array(
762 "function" => "i_echoStringArray",
763 "signature" => $i_echoStringArray_sig,
764 "docstring" => $i_echoStringArray_doc
766 "interopEchoTests.echoInteger" => array(
767 "function" => "i_echoInteger",
768 "signature" => $i_echoInteger_sig,
769 "docstring" => $i_echoInteger_doc
771 "interopEchoTests.echoIntegerArray" => array(
772 "function" => "i_echoIntegerArray",
773 "signature" => $i_echoIntegerArray_sig,
774 "docstring" => $i_echoIntegerArray_doc
776 "interopEchoTests.echoFloat" => array(
777 "function" => "i_echoFloat",
778 "signature" => $i_echoFloat_sig,
779 "docstring" => $i_echoFloat_doc
781 "interopEchoTests.echoFloatArray" => array(
782 "function" => "i_echoFloatArray",
783 "signature" => $i_echoFloatArray_sig,
784 "docstring" => $i_echoFloatArray_doc
786 "interopEchoTests.echoStruct" => array(
787 "function" => "i_echoStruct",
788 "signature" => $i_echoStruct_sig,
789 "docstring" => $i_echoStruct_doc
791 "interopEchoTests.echoStructArray" => array(
792 "function" => "i_echoStructArray",
793 "signature" => $i_echoStructArray_sig,
794 "docstring" => $i_echoStructArray_doc
796 "interopEchoTests.echoValue" => array(
797 "function" => "i_echoValue",
798 "signature" => $i_echoValue_sig,
799 "docstring" => $i_echoValue_doc
801 "interopEchoTests.echoBase64" => array(
802 "function" => "i_echoBase64",
803 "signature" => $i_echoBase64_sig,
804 "docstring" => $i_echoBase64_doc
806 "interopEchoTests.echoDate" => array(
807 "function" => "i_echoDate",
808 "signature" => $i_echoDate_sig,
809 "docstring" => $i_echoDate_doc
811 "interopEchoTests.whichToolkit" => array(
812 "function" => "i_whichToolkit",
813 "signature" => $i_whichToolkit_sig,
814 "docstring" => $i_whichToolkit_doc
819 $a['examples.php.getStateName'] = $findstate2_sig;
822 $a['examples.php2.getStateName'] = $findstate3_sig;
825 $a['examples.php3.getStateName'] = $findstate4_sig;
828 $a['examples.php4.getStateName'] = $findstate5_sig;
830 $s=new xmlrpc_server($a, false);
832 $s->compress_response = true;
834 // out-of-band information: let the client manipulate the server operations.
835 // we do this to help the testsuite script: do not reproduce in production!
836 if (isset($_GET['RESPONSE_ENCODING']))
837 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
840 // that should do all we need!