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 $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';
142 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"int"));
145 $addtwodouble_sig=array(array($xmlrpcDouble, $xmlrpcDouble, $xmlrpcDouble));
146 $addtwodouble_doc='Add two doubles together and return the result';
147 function addtwodouble($m)
151 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"double"));
154 $stringecho_sig=array(array($xmlrpcString, $xmlrpcString));
155 $stringecho_doc='Accepts a string parameter, returns the string.';
156 function stringecho($m)
158 // just sends back a string
160 $v = $s->scalarval();
161 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
164 $echoback_sig=array(array($xmlrpcString, $xmlrpcString));
165 $echoback_doc='Accepts a string parameter, returns the entire incoming payload';
166 function echoback($m)
168 // just sends back a string with what i got
169 // sent to me, just escaped, that's all
171 // $m is an incoming message
172 $s="I got the following message:\n" . $m->serialize();
173 return new xmlrpcresp(new xmlrpcval($s));
176 $echosixtyfour_sig=array(array($xmlrpcString, $xmlrpcBase64));
177 $echosixtyfour_doc='Accepts a base64 parameter and returns it decoded as a string';
178 function echosixtyfour($m)
180 // accepts an encoded value, but sends it back
181 // as a normal string. this is to test base64 encoding
182 // is working as expected
183 $incoming=$m->getParam(0);
184 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
187 $bitflipper_sig=array(array($xmlrpcArray, $xmlrpcArray));
188 $bitflipper_doc='Accepts an array of booleans, and returns them inverted';
189 function bitflipper($m)
195 $rv=new xmlrpcval(array(), $xmlrpcArray);
197 for($j=0; $j<$sz; $j++)
202 $rv->addScalar(false, "boolean");
206 $rv->addScalar(true, "boolean");
210 return new xmlrpcresp($rv);
215 // send me an array of structs thus:
222 // and I'll return it to you in sorted order
224 function agesorter_compare($a, $b)
226 global $agesorter_arr;
228 // don't even ask me _why_ these come padded with
229 // hyphens, I couldn't tell you :p
230 $a=str_replace("-", "", $a);
231 $b=str_replace("-", "", $b);
233 if ($agesorter_arr[$a]==$agesorter[$b])
237 return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
240 $agesorter_sig=array(array($xmlrpcArray, $xmlrpcArray));
241 $agesorter_doc='Send this method an array of [string, int] structs, eg:
248 And the array will be returned with the entries sorted by their numbers.
250 function agesorter($m)
252 global $agesorter_arr, $xmlrpcerruser, $s;
254 xmlrpc_debugmsg("Entering 'agesorter'");
256 $sno=$m->getParam(0);
257 // error string for [if|when] things go wrong
259 // create the output value
263 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++)
270 $rec=$sno->arraymem($i);
271 if ($rec->kindOf()!="struct")
273 $err="Found non-struct in array at element $i";
276 // extract name and age from struct
277 $n=$rec->structmem("name");
278 $a=$rec->structmem("age");
279 // $n and $a are xmlrpcvals,
280 // so get the scalarval from them
281 $agar[$n->scalarval()]=$a->scalarval();
284 $agesorter_arr=$agar;
285 // hack, must make global as uksort() won't
286 // allow us to pass any other auxilliary information
287 uksort($agesorter_arr, agesorter_compare);
289 while (list( $key, $val ) = each( $agesorter_arr ) )
291 // recreate each struct element
292 $outAr[]=new xmlrpcval(array("name" =>
295 new xmlrpcval($val, "int")), "struct");
297 // add this array to the output value
298 $v->addArray($outAr);
302 $err="Must be one parameter, an array of structs";
307 return new xmlrpcresp(0, $xmlrpcerruser, $err);
311 return new xmlrpcresp($v);
315 // signature and instructions, place these in the dispatch
317 $mail_send_sig=array(array(
318 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
319 $xmlrpcString, $xmlrpcString, $xmlrpcString,
320 $xmlrpcString, $xmlrpcString
323 $mail_send_doc='mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
324 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
325 subject is a string, the subject of the message.<br/>
326 sender is a string, it\'s the email address of the person sending the message. This string can not be
327 a comma-separated list, it must contain a single email address only.<br/>
328 text is a string, it contains the body of the message.<br/>
329 mimetype, a string, is a standard MIME type, for example, text/plain.
331 // WARNING; this functionality depends on the sendmail -t option
332 // it may not work with Windows machines properly; particularly
333 // the Bcc option. Sneak on your friends at your own risk!
334 function mail_send($m)
336 global $xmlrpcerruser, $xmlrpcBoolean;
339 $mTo=$m->getParam(0);
340 $mSub=$m->getParam(1);
341 $mBody=$m->getParam(2);
342 $mFrom=$m->getParam(3);
343 $mCc=$m->getParam(4);
344 $mBcc=$m->getParam(5);
345 $mMime=$m->getParam(6);
347 if ($mTo->scalarval()=="")
349 $err="Error, no 'To' field specified";
352 if ($mFrom->scalarval()=="")
354 $err="Error, no 'From' field specified";
357 $msghdr="From: " . $mFrom->scalarval() . "\n";
358 $msghdr.="To: ". $mTo->scalarval() . "\n";
360 if ($mCc->scalarval()!="")
362 $msghdr.="Cc: " . $mCc->scalarval(). "\n";
364 if ($mBcc->scalarval()!="")
366 $msghdr.="Bcc: " . $mBcc->scalarval(). "\n";
368 if ($mMime->scalarval()!="")
370 $msghdr.="Content-type: " . $mMime->scalarval() . "\n";
372 $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0";
381 $err="Error, could not send the mail.";
387 return new xmlrpcresp(0, $xmlrpcerruser, $err);
391 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
395 $getallheaders_sig=array(array($xmlrpcStruct));
396 $getallheaders_doc='Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
397 function getallheaders_xmlrpc($m)
399 global $xmlrpcerruser;
400 if (function_exists('getallheaders'))
402 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
407 // IIS: poor man's version of getallheaders
408 foreach ($_SERVER as $key => $val)
409 if (strpos($key, 'HTTP_') === 0)
411 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
412 $headers[$key] = $val;
414 return new xmlrpcresp(php_xmlrpc_encode($headers));
418 $setcookies_sig=array(array($xmlrpcInt, $xmlrpcStruct));
419 $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)';
420 function setcookies($m)
422 $m = $m->getParam(0);
423 while(list($name,$value) = $m->structeach())
425 $cookiedesc = php_xmlrpc_decode($value);
426 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
428 return new xmlrpcresp(new xmlrpcval(1, 'int'));
431 $getcookies_sig=array(array($xmlrpcStruct));
432 $getcookies_doc='Sends to client a response containing all http cookies as received in the request (as struct)';
433 function getcookies($m)
435 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
438 $v1_arrayOfStructs_sig=array(array($xmlrpcInt, $xmlrpcArray));
439 $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.';
440 function v1_arrayOfStructs($m)
442 $sno=$m->getParam(0);
444 for($i=0; $i<$sno->arraysize(); $i++)
446 $str=$sno->arraymem($i);
448 while(list($key,$val)=$str->structeach())
452 $numcurly+=$val->scalarval();
456 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
459 $v1_easyStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
460 $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.';
461 function v1_easyStruct($m)
463 $sno=$m->getParam(0);
464 $moe=$sno->structmem("moe");
465 $larry=$sno->structmem("larry");
466 $curly=$sno->structmem("curly");
467 $num=$moe->scalarval() + $larry->scalarval() + $curly->scalarval();
468 return new xmlrpcresp(new xmlrpcval($num, "int"));
471 $v1_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
472 $v1_echoStruct_doc='This handler takes a single parameter, a struct. Your handler must return the struct.';
473 function v1_echoStruct($m)
475 $sno=$m->getParam(0);
476 return new xmlrpcresp($sno);
479 $v1_manyTypes_sig=array(array(
480 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
481 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
484 $v1_manyTypes_doc='This handler takes six parameters, and returns an array containing all the parameters.';
485 function v1_manyTypes($m)
487 return new xmlrpcresp(new xmlrpcval(array(
498 $v1_moderateSizeArrayCheck_sig=array(array($xmlrpcString, $xmlrpcArray));
499 $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.';
500 function v1_moderateSizeArrayCheck($m)
503 $sz=$ar->arraysize();
504 $first=$ar->arraymem(0);
505 $last=$ar->arraymem($sz-1);
506 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
507 $last->scalarval(), "string"));
510 $v1_simpleStructReturn_sig=array(array($xmlrpcStruct, $xmlrpcInt));
511 $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.';
512 function v1_simpleStructReturn($m)
514 $sno=$m->getParam(0);
515 $v=$sno->scalarval();
516 return new xmlrpcresp(new xmlrpcval(array(
517 "times10" => new xmlrpcval($v*10, "int"),
518 "times100" => new xmlrpcval($v*100, "int"),
519 "times1000" => new xmlrpcval($v*1000, "int")),
524 $v1_nestedStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
525 $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.';
526 function v1_nestedStruct($m)
528 $sno=$m->getParam(0);
530 $twoK=$sno->structmem("2000");
531 $april=$twoK->structmem("04");
532 $fools=$april->structmem("01");
533 $curly=$fools->structmem("curly");
534 $larry=$fools->structmem("larry");
535 $moe=$fools->structmem("moe");
536 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
539 $v1_countTheEntities_sig=array(array($xmlrpcStruct, $xmlrpcString));
540 $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.';
541 function v1_countTheEntities($m)
543 $sno=$m->getParam(0);
544 $str=$sno->scalarval();
545 $gt=0; $lt=0; $ap=0; $qu=0; $amp=0;
546 for($i=0; $i<strlen($str); $i++)
548 $c=substr($str, $i, 1);
570 return new xmlrpcresp(new xmlrpcval(array(
571 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
572 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
573 "ctAmpersands" => new xmlrpcval($amp, "int"),
574 "ctApostrophes" => new xmlrpcval($ap, "int"),
575 "ctQuotes" => new xmlrpcval($qu, "int")),
580 // trivial interop tests
581 // http://www.xmlrpc.com/stories/storyReader$1636
583 $i_echoString_sig=array(array($xmlrpcString, $xmlrpcString));
584 $i_echoString_doc="Echoes string.";
586 $i_echoStringArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
587 $i_echoStringArray_doc="Echoes string array.";
589 $i_echoInteger_sig=array(array($xmlrpcInt, $xmlrpcInt));
590 $i_echoInteger_doc="Echoes integer.";
592 $i_echoIntegerArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
593 $i_echoIntegerArray_doc="Echoes integer array.";
595 $i_echoFloat_sig=array(array($xmlrpcDouble, $xmlrpcDouble));
596 $i_echoFloat_doc="Echoes float.";
598 $i_echoFloatArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
599 $i_echoFloatArray_doc="Echoes float array.";
601 $i_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
602 $i_echoStruct_doc="Echoes struct.";
604 $i_echoStructArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
605 $i_echoStructArray_doc="Echoes struct array.";
607 $i_echoValue_doc="Echoes any value back.";
608 $i_echoValue_sig=array(array($xmlrpcValue, $xmlrpcValue));
610 $i_echoBase64_sig=array(array($xmlrpcBase64, $xmlrpcBase64));
611 $i_echoBase64_doc="Echoes base64.";
613 $i_echoDate_sig=array(array($xmlrpcDateTime, $xmlrpcDateTime));
614 $i_echoDate_doc="Echoes dateTime.";
616 function i_echoParam($m)
619 return new xmlrpcresp($s);
622 function i_echoString($m) { return i_echoParam($m); }
623 function i_echoInteger($m) { return i_echoParam($m); }
624 function i_echoFloat($m) { return i_echoParam($m); }
625 function i_echoStruct($m) { return i_echoParam($m); }
626 function i_echoStringArray($m) { return i_echoParam($m); }
627 function i_echoIntegerArray($m) { return i_echoParam($m); }
628 function i_echoFloatArray($m) { return i_echoParam($m); }
629 function i_echoStructArray($m) { return i_echoParam($m); }
630 function i_echoValue($m) { return i_echoParam($m); }
631 function i_echoBase64($m) { return i_echoParam($m); }
632 function i_echoDate($m) { return i_echoParam($m); }
634 $i_whichToolkit_sig=array(array($xmlrpcStruct));
635 $i_whichToolkit_doc="Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
637 function i_whichToolkit($m)
639 global $xmlrpcName, $xmlrpcVersion,$SERVER_SOFTWARE;
641 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
642 "toolkitName" => $xmlrpcName,
643 "toolkitVersion" => $xmlrpcVersion,
644 "toolkitOperatingSystem" => isset ($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']
646 return new xmlrpcresp ( php_xmlrpc_encode($ret));
649 $o=new xmlrpc_server_methods_container;
651 "examples.getStateName" => array(
652 "function" => "findstate",
653 "signature" => $findstate_sig,
654 "docstring" => $findstate_doc
656 "examples.sortByAge" => array(
657 "function" => "agesorter",
658 "signature" => $agesorter_sig,
659 "docstring" => $agesorter_doc
661 "examples.addtwo" => array(
662 "function" => "addtwo",
663 "signature" => $addtwo_sig,
664 "docstring" => $addtwo_doc
666 "examples.addtwodouble" => array(
667 "function" => "addtwodouble",
668 "signature" => $addtwodouble_sig,
669 "docstring" => $addtwodouble_doc
671 "examples.stringecho" => array(
672 "function" => "stringecho",
673 "signature" => $stringecho_sig,
674 "docstring" => $stringecho_doc
676 "examples.echo" => array(
677 "function" => "echoback",
678 "signature" => $echoback_sig,
679 "docstring" => $echoback_doc
681 "examples.decode64" => array(
682 "function" => "echosixtyfour",
683 "signature" => $echosixtyfour_sig,
684 "docstring" => $echosixtyfour_doc
686 "examples.invertBooleans" => array(
687 "function" => "bitflipper",
688 "signature" => $bitflipper_sig,
689 "docstring" => $bitflipper_doc
691 "examples.generatePHPWarning" => array(
692 "function" => array($o, "phpwarninggenerator")
693 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
695 "examples.getallheaders" => array(
696 "function" => 'getallheaders_xmlrpc',
697 "signature" => $getallheaders_sig,
698 "docstring" => $getallheaders_doc
700 "examples.setcookies" => array(
701 "function" => 'setcookies',
702 "signature" => $setcookies_sig,
703 "docstring" => $setcookies_doc
705 "examples.getcookies" => array(
706 "function" => 'getcookies',
707 "signature" => $getcookies_sig,
708 "docstring" => $getcookies_doc
710 "mail.send" => array(
711 "function" => "mail_send",
712 "signature" => $mail_send_sig,
713 "docstring" => $mail_send_doc
715 "validator1.arrayOfStructsTest" => array(
716 "function" => "v1_arrayOfStructs",
717 "signature" => $v1_arrayOfStructs_sig,
718 "docstring" => $v1_arrayOfStructs_doc
720 "validator1.easyStructTest" => array(
721 "function" => "v1_easyStruct",
722 "signature" => $v1_easyStruct_sig,
723 "docstring" => $v1_easyStruct_doc
725 "validator1.echoStructTest" => array(
726 "function" => "v1_echoStruct",
727 "signature" => $v1_echoStruct_sig,
728 "docstring" => $v1_echoStruct_doc
730 "validator1.manyTypesTest" => array(
731 "function" => "v1_manyTypes",
732 "signature" => $v1_manyTypes_sig,
733 "docstring" => $v1_manyTypes_doc
735 "validator1.moderateSizeArrayCheck" => array(
736 "function" => "v1_moderateSizeArrayCheck",
737 "signature" => $v1_moderateSizeArrayCheck_sig,
738 "docstring" => $v1_moderateSizeArrayCheck_doc
740 "validator1.simpleStructReturnTest" => array(
741 "function" => "v1_simpleStructReturn",
742 "signature" => $v1_simpleStructReturn_sig,
743 "docstring" => $v1_simpleStructReturn_doc
745 "validator1.nestedStructTest" => array(
746 "function" => "v1_nestedStruct",
747 "signature" => $v1_nestedStruct_sig,
748 "docstring" => $v1_nestedStruct_doc
750 "validator1.countTheEntities" => array(
751 "function" => "v1_countTheEntities",
752 "signature" => $v1_countTheEntities_sig,
753 "docstring" => $v1_countTheEntities_doc
755 "interopEchoTests.echoString" => array(
756 "function" => "i_echoString",
757 "signature" => $i_echoString_sig,
758 "docstring" => $i_echoString_doc
760 "interopEchoTests.echoStringArray" => array(
761 "function" => "i_echoStringArray",
762 "signature" => $i_echoStringArray_sig,
763 "docstring" => $i_echoStringArray_doc
765 "interopEchoTests.echoInteger" => array(
766 "function" => "i_echoInteger",
767 "signature" => $i_echoInteger_sig,
768 "docstring" => $i_echoInteger_doc
770 "interopEchoTests.echoIntegerArray" => array(
771 "function" => "i_echoIntegerArray",
772 "signature" => $i_echoIntegerArray_sig,
773 "docstring" => $i_echoIntegerArray_doc
775 "interopEchoTests.echoFloat" => array(
776 "function" => "i_echoFloat",
777 "signature" => $i_echoFloat_sig,
778 "docstring" => $i_echoFloat_doc
780 "interopEchoTests.echoFloatArray" => array(
781 "function" => "i_echoFloatArray",
782 "signature" => $i_echoFloatArray_sig,
783 "docstring" => $i_echoFloatArray_doc
785 "interopEchoTests.echoStruct" => array(
786 "function" => "i_echoStruct",
787 "signature" => $i_echoStruct_sig,
788 "docstring" => $i_echoStruct_doc
790 "interopEchoTests.echoStructArray" => array(
791 "function" => "i_echoStructArray",
792 "signature" => $i_echoStructArray_sig,
793 "docstring" => $i_echoStructArray_doc
795 "interopEchoTests.echoValue" => array(
796 "function" => "i_echoValue",
797 "signature" => $i_echoValue_sig,
798 "docstring" => $i_echoValue_doc
800 "interopEchoTests.echoBase64" => array(
801 "function" => "i_echoBase64",
802 "signature" => $i_echoBase64_sig,
803 "docstring" => $i_echoBase64_doc
805 "interopEchoTests.echoDate" => array(
806 "function" => "i_echoDate",
807 "signature" => $i_echoDate_sig,
808 "docstring" => $i_echoDate_doc
810 "interopEchoTests.whichToolkit" => array(
811 "function" => "i_whichToolkit",
812 "signature" => $i_whichToolkit_sig,
813 "docstring" => $i_whichToolkit_doc
818 $a['examples.php.getStateName'] = $findstate2_sig;
821 $a['examples.php2.getStateName'] = $findstate3_sig;
824 $a['examples.php3.getStateName'] = $findstate4_sig;
826 $s=new xmlrpc_server($a, false);
828 $s->compress_response = true;
830 // out-of-band information: let the client manipulate the server operations.
831 // we do this to help the testsuite script: do not reproduce in production!
832 if (isset($_GET['RESPONSE_ENCODING']))
833 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
836 // that should do all we need!