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("xmlrpc.inc");
21 include("xmlrpcs.inc");
22 include("xmlrpc_wrappers.inc");
25 * Used to test usage of object methods in dispatch maps and in wrapper code
27 class xmlrpc_server_methods_container
30 * Method used to test logging of php warnings generated by user functions.
32 function phpwarninggenerator($m)
34 $a = $b; // this triggers a warning in E_ALL mode, since $b is undefined
35 return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
39 * Method used to testcatching of exceptions in the server.
41 function exceptiongenerator($m)
43 throw new Exception("it's just a test", 1);
47 * a PHP version of the state-number server. Send me an integer and i'll sell you a state
51 static function findstate($s)
53 return inner_findstate($s);
59 // of the state-number server
60 // send me an integer and i'll sell you a state
63 "Alabama", "Alaska", "Arizona", "Arkansas", "California",
64 "Colorado", "Columbia", "Connecticut", "Delaware", "Florida",
65 "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
66 "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
67 "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
68 "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina",
69 "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
70 "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
71 "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"
74 $findstate_sig=array(array($xmlrpcString, $xmlrpcInt));
75 $findstate_doc='When passed an integer between 1 and 51 returns the
76 name of a US state, where the integer is the index of that state name
77 in an alphabetic order.';
80 function findstate($m)
82 global $xmlrpcerruser, $stateNames;
84 // get the first param
87 // param must be there and of the correct type: server object does the
90 // extract the value of the state number
91 $snv=$sno->scalarval();
92 // look it up in our array (zero-based)
93 if (isset($stateNames[$snv-1]))
95 $sname=$stateNames[$snv-1];
99 // not, there so complain
100 $err="I don't have a state for the index '" . $snv . "'";
103 // if we generated an error, create an error return response
106 return new xmlrpcresp(0, $xmlrpcerruser, $err);
110 // otherwise, we create the right response
111 // with the state name
112 return new xmlrpcresp(new xmlrpcval($sname));
117 * Inner code of the state-number server.
118 * Used to test auto-registration of PHP funcions as xmlrpc methods.
119 * @param integer $stateno the state number
120 * @return string the name of the state (or error descrption)
122 function inner_findstate($stateno)
125 if (isset($stateNames[$stateno-1]))
127 return $stateNames[$stateno-1];
131 // not, there so complain
132 return "I don't have a state for the index '" . $stateno . "'";
135 $findstate2_sig = wrap_php_function('inner_findstate');
137 $findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
139 $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
141 $obj = new xmlrpc_server_methods_container();
142 $findstate4_sig = wrap_php_function(array($obj, 'findstate'));
144 $addtwo_sig=array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
145 $addtwo_doc='Add two integers together and return the result';
150 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"int"));
153 $addtwodouble_sig=array(array($xmlrpcDouble, $xmlrpcDouble, $xmlrpcDouble));
154 $addtwodouble_doc='Add two doubles together and return the result';
155 function addtwodouble($m)
159 return new xmlrpcresp(new xmlrpcval($s->scalarval()+$t->scalarval(),"double"));
162 $stringecho_sig=array(array($xmlrpcString, $xmlrpcString));
163 $stringecho_doc='Accepts a string parameter, returns the string.';
164 function stringecho($m)
166 // just sends back a string
168 $v = $s->scalarval();
169 return new xmlrpcresp(new xmlrpcval($s->scalarval()));
172 $echoback_sig=array(array($xmlrpcString, $xmlrpcString));
173 $echoback_doc='Accepts a string parameter, returns the entire incoming payload';
174 function echoback($m)
176 // just sends back a string with what i got
177 // sent to me, just escaped, that's all
179 // $m is an incoming message
180 $s="I got the following message:\n" . $m->serialize();
181 return new xmlrpcresp(new xmlrpcval($s));
184 $echosixtyfour_sig=array(array($xmlrpcString, $xmlrpcBase64));
185 $echosixtyfour_doc='Accepts a base64 parameter and returns it decoded as a string';
186 function echosixtyfour($m)
188 // accepts an encoded value, but sends it back
189 // as a normal string. this is to test base64 encoding
190 // is working as expected
191 $incoming=$m->getParam(0);
192 return new xmlrpcresp(new xmlrpcval($incoming->scalarval(), "string"));
195 $bitflipper_sig=array(array($xmlrpcArray, $xmlrpcArray));
196 $bitflipper_doc='Accepts an array of booleans, and returns them inverted';
197 function bitflipper($m)
203 $rv=new xmlrpcval(array(), $xmlrpcArray);
205 for($j=0; $j<$sz; $j++)
210 $rv->addScalar(false, "boolean");
214 $rv->addScalar(true, "boolean");
218 return new xmlrpcresp($rv);
223 // send me an array of structs thus:
230 // and I'll return it to you in sorted order
232 function agesorter_compare($a, $b)
234 global $agesorter_arr;
236 // don't even ask me _why_ these come padded with
237 // hyphens, I couldn't tell you :p
238 $a=str_replace("-", "", $a);
239 $b=str_replace("-", "", $b);
241 if ($agesorter_arr[$a]==$agesorter[$b])
245 return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
248 $agesorter_sig=array(array($xmlrpcArray, $xmlrpcArray));
249 $agesorter_doc='Send this method an array of [string, int] structs, eg:
256 And the array will be returned with the entries sorted by their numbers.
258 function agesorter($m)
260 global $agesorter_arr, $xmlrpcerruser, $s;
262 xmlrpc_debugmsg("Entering 'agesorter'");
264 $sno=$m->getParam(0);
265 // error string for [if|when] things go wrong
267 // create the output value
271 if (isset($sno) && $sno->kindOf()=="array")
273 $max=$sno->arraysize();
274 // TODO: create debug method to print can work once more
275 // print "<!-- found $max array elements -->\n";
276 for($i=0; $i<$max; $i++)
278 $rec=$sno->arraymem($i);
279 if ($rec->kindOf()!="struct")
281 $err="Found non-struct in array at element $i";
284 // extract name and age from struct
285 $n=$rec->structmem("name");
286 $a=$rec->structmem("age");
287 // $n and $a are xmlrpcvals,
288 // so get the scalarval from them
289 $agar[$n->scalarval()]=$a->scalarval();
292 $agesorter_arr=$agar;
293 // hack, must make global as uksort() won't
294 // allow us to pass any other auxilliary information
295 uksort($agesorter_arr, agesorter_compare);
297 while (list( $key, $val ) = each( $agesorter_arr ) )
299 // recreate each struct element
300 $outAr[]=new xmlrpcval(array("name" =>
303 new xmlrpcval($val, "int")), "struct");
305 // add this array to the output value
306 $v->addArray($outAr);
310 $err="Must be one parameter, an array of structs";
315 return new xmlrpcresp(0, $xmlrpcerruser, $err);
319 return new xmlrpcresp($v);
323 // signature and instructions, place these in the dispatch
325 $mail_send_sig=array(array(
326 $xmlrpcBoolean, $xmlrpcString, $xmlrpcString,
327 $xmlrpcString, $xmlrpcString, $xmlrpcString,
328 $xmlrpcString, $xmlrpcString
331 $mail_send_doc='mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
332 recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
333 subject is a string, the subject of the message.<br/>
334 sender is a string, it\'s the email address of the person sending the message. This string can not be
335 a comma-separated list, it must contain a single email address only.<br/>
336 text is a string, it contains the body of the message.<br/>
337 mimetype, a string, is a standard MIME type, for example, text/plain.
339 // WARNING; this functionality depends on the sendmail -t option
340 // it may not work with Windows machines properly; particularly
341 // the Bcc option. Sneak on your friends at your own risk!
342 function mail_send($m)
344 global $xmlrpcerruser, $xmlrpcBoolean;
347 $mTo=$m->getParam(0);
348 $mSub=$m->getParam(1);
349 $mBody=$m->getParam(2);
350 $mFrom=$m->getParam(3);
351 $mCc=$m->getParam(4);
352 $mBcc=$m->getParam(5);
353 $mMime=$m->getParam(6);
355 if ($mTo->scalarval()=="")
357 $err="Error, no 'To' field specified";
360 if ($mFrom->scalarval()=="")
362 $err="Error, no 'From' field specified";
365 $msghdr="From: " . $mFrom->scalarval() . "\n";
366 $msghdr.="To: ". $mTo->scalarval() . "\n";
368 if ($mCc->scalarval()!="")
370 $msghdr.="Cc: " . $mCc->scalarval(). "\n";
372 if ($mBcc->scalarval()!="")
374 $msghdr.="Bcc: " . $mBcc->scalarval(). "\n";
376 if ($mMime->scalarval()!="")
378 $msghdr.="Content-type: " . $mMime->scalarval() . "\n";
380 $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0";
389 $err="Error, could not send the mail.";
395 return new xmlrpcresp(0, $xmlrpcerruser, $err);
399 return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));
403 $getallheaders_sig=array(array($xmlrpcStruct));
404 $getallheaders_doc='Returns a struct containing all the HTTP headers received with the request. Provides limited functionality with IIS';
405 function getallheaders_xmlrpc($m)
407 global $xmlrpcerruser;
408 if (function_exists('getallheaders'))
410 return new xmlrpcresp(php_xmlrpc_encode(getallheaders()));
415 // IIS: poor man's version of getallheaders
416 foreach ($_SERVER as $key => $val)
417 if (strpos($key, 'HTTP_') === 0)
419 $key = ucfirst(str_replace('_', '-', strtolower(substr($key, 5))));
420 $headers[$key] = $val;
422 return new xmlrpcresp(php_xmlrpc_encode($headers));
426 $setcookies_sig=array(array($xmlrpcInt, $xmlrpcStruct));
427 $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)';
428 function setcookies($m)
430 $m = $m->getParam(0);
431 while(list($name,$value) = $m->structeach())
433 $cookiedesc = php_xmlrpc_decode($value);
434 setcookie($name, @$cookiedesc['value'], @$cookiedesc['expires'], @$cookiedesc['path'], @$cookiedesc['domain'], @$cookiedesc['secure']);
436 return new xmlrpcresp(new xmlrpcval(1, 'int'));
439 $getcookies_sig=array(array($xmlrpcStruct));
440 $getcookies_doc='Sends to client a response containing all http cookies as received in the request (as struct)';
441 function getcookies($m)
443 return new xmlrpcresp(php_xmlrpc_encode($_COOKIE));
446 $v1_arrayOfStructs_sig=array(array($xmlrpcInt, $xmlrpcArray));
447 $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.';
448 function v1_arrayOfStructs($m)
450 $sno=$m->getParam(0);
452 for($i=0; $i<$sno->arraysize(); $i++)
454 $str=$sno->arraymem($i);
456 while(list($key,$val)=$str->structeach())
460 $numcurly+=$val->scalarval();
464 return new xmlrpcresp(new xmlrpcval($numcurly, "int"));
467 $v1_easyStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
468 $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.';
469 function v1_easyStruct($m)
471 $sno=$m->getParam(0);
472 $moe=$sno->structmem("moe");
473 $larry=$sno->structmem("larry");
474 $curly=$sno->structmem("curly");
475 $num=$moe->scalarval() + $larry->scalarval() + $curly->scalarval();
476 return new xmlrpcresp(new xmlrpcval($num, "int"));
479 $v1_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
480 $v1_echoStruct_doc='This handler takes a single parameter, a struct. Your handler must return the struct.';
481 function v1_echoStruct($m)
483 $sno=$m->getParam(0);
484 return new xmlrpcresp($sno);
487 $v1_manyTypes_sig=array(array(
488 $xmlrpcArray, $xmlrpcInt, $xmlrpcBoolean,
489 $xmlrpcString, $xmlrpcDouble, $xmlrpcDateTime,
492 $v1_manyTypes_doc='This handler takes six parameters, and returns an array containing all the parameters.';
493 function v1_manyTypes($m)
495 return new xmlrpcresp(new xmlrpcval(array(
506 $v1_moderateSizeArrayCheck_sig=array(array($xmlrpcString, $xmlrpcArray));
507 $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.';
508 function v1_moderateSizeArrayCheck($m)
511 $sz=$ar->arraysize();
512 $first=$ar->arraymem(0);
513 $last=$ar->arraymem($sz-1);
514 return new xmlrpcresp(new xmlrpcval($first->scalarval() .
515 $last->scalarval(), "string"));
518 $v1_simpleStructReturn_sig=array(array($xmlrpcStruct, $xmlrpcInt));
519 $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.';
520 function v1_simpleStructReturn($m)
522 $sno=$m->getParam(0);
523 $v=$sno->scalarval();
524 return new xmlrpcresp(new xmlrpcval(array(
525 "times10" => new xmlrpcval($v*10, "int"),
526 "times100" => new xmlrpcval($v*100, "int"),
527 "times1000" => new xmlrpcval($v*1000, "int")),
532 $v1_nestedStruct_sig=array(array($xmlrpcInt, $xmlrpcStruct));
533 $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.';
534 function v1_nestedStruct($m)
536 $sno=$m->getParam(0);
538 $twoK=$sno->structmem("2000");
539 $april=$twoK->structmem("04");
540 $fools=$april->structmem("01");
541 $curly=$fools->structmem("curly");
542 $larry=$fools->structmem("larry");
543 $moe=$fools->structmem("moe");
544 return new xmlrpcresp(new xmlrpcval($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), "int"));
547 $v1_countTheEntities_sig=array(array($xmlrpcStruct, $xmlrpcString));
548 $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.';
549 function v1_countTheEntities($m)
551 $sno=$m->getParam(0);
552 $str=$sno->scalarval();
553 $gt=0; $lt=0; $ap=0; $qu=0; $amp=0;
554 for($i=0; $i<strlen($str); $i++)
556 $c=substr($str, $i, 1);
578 return new xmlrpcresp(new xmlrpcval(array(
579 "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
580 "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
581 "ctAmpersands" => new xmlrpcval($amp, "int"),
582 "ctApostrophes" => new xmlrpcval($ap, "int"),
583 "ctQuotes" => new xmlrpcval($qu, "int")),
588 // trivial interop tests
589 // http://www.xmlrpc.com/stories/storyReader$1636
591 $i_echoString_sig=array(array($xmlrpcString, $xmlrpcString));
592 $i_echoString_doc="Echoes string.";
594 $i_echoStringArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
595 $i_echoStringArray_doc="Echoes string array.";
597 $i_echoInteger_sig=array(array($xmlrpcInt, $xmlrpcInt));
598 $i_echoInteger_doc="Echoes integer.";
600 $i_echoIntegerArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
601 $i_echoIntegerArray_doc="Echoes integer array.";
603 $i_echoFloat_sig=array(array($xmlrpcDouble, $xmlrpcDouble));
604 $i_echoFloat_doc="Echoes float.";
606 $i_echoFloatArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
607 $i_echoFloatArray_doc="Echoes float array.";
609 $i_echoStruct_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
610 $i_echoStruct_doc="Echoes struct.";
612 $i_echoStructArray_sig=array(array($xmlrpcArray, $xmlrpcArray));
613 $i_echoStructArray_doc="Echoes struct array.";
615 $i_echoValue_doc="Echoes any value back.";
616 $i_echoValue_sig=array(array($xmlrpcValue, $xmlrpcValue));
618 $i_echoBase64_sig=array(array($xmlrpcBase64, $xmlrpcBase64));
619 $i_echoBase64_doc="Echoes base64.";
621 $i_echoDate_sig=array(array($xmlrpcDateTime, $xmlrpcDateTime));
622 $i_echoDate_doc="Echoes dateTime.";
624 function i_echoParam($m)
627 return new xmlrpcresp($s);
630 function i_echoString($m) { return i_echoParam($m); }
631 function i_echoInteger($m) { return i_echoParam($m); }
632 function i_echoFloat($m) { return i_echoParam($m); }
633 function i_echoStruct($m) { return i_echoParam($m); }
634 function i_echoStringArray($m) { return i_echoParam($m); }
635 function i_echoIntegerArray($m) { return i_echoParam($m); }
636 function i_echoFloatArray($m) { return i_echoParam($m); }
637 function i_echoStructArray($m) { return i_echoParam($m); }
638 function i_echoValue($m) { return i_echoParam($m); }
639 function i_echoBase64($m) { return i_echoParam($m); }
640 function i_echoDate($m) { return i_echoParam($m); }
642 $i_whichToolkit_sig=array(array($xmlrpcStruct));
643 $i_whichToolkit_doc="Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
645 function i_whichToolkit($m)
647 global $xmlrpcName, $xmlrpcVersion,$SERVER_SOFTWARE;
649 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
650 "toolkitName" => $xmlrpcName,
651 "toolkitVersion" => $xmlrpcVersion,
652 "toolkitOperatingSystem" => isset ($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']
654 return new xmlrpcresp ( php_xmlrpc_encode($ret));
657 $o=new xmlrpc_server_methods_container;
659 "examples.getStateName" => array(
660 "function" => "findstate",
661 "signature" => $findstate_sig,
662 "docstring" => $findstate_doc
664 "examples.sortByAge" => array(
665 "function" => "agesorter",
666 "signature" => $agesorter_sig,
667 "docstring" => $agesorter_doc
669 "examples.addtwo" => array(
670 "function" => "addtwo",
671 "signature" => $addtwo_sig,
672 "docstring" => $addtwo_doc
674 "examples.addtwodouble" => array(
675 "function" => "addtwodouble",
676 "signature" => $addtwodouble_sig,
677 "docstring" => $addtwodouble_doc
679 "examples.stringecho" => array(
680 "function" => "stringecho",
681 "signature" => $stringecho_sig,
682 "docstring" => $stringecho_doc
684 "examples.echo" => array(
685 "function" => "echoback",
686 "signature" => $echoback_sig,
687 "docstring" => $echoback_doc
689 "examples.decode64" => array(
690 "function" => "echosixtyfour",
691 "signature" => $echosixtyfour_sig,
692 "docstring" => $echosixtyfour_doc
694 "examples.invertBooleans" => array(
695 "function" => "bitflipper",
696 "signature" => $bitflipper_sig,
697 "docstring" => $bitflipper_doc
699 "examples.generatePHPWarning" => array(
700 "function" => array($o, "phpwarninggenerator")
701 //'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
703 "examples.raiseException" => array(
704 "function" => array($o, "exceptiongenerator")
706 "examples.getallheaders" => array(
707 "function" => 'getallheaders_xmlrpc',
708 "signature" => $getallheaders_sig,
709 "docstring" => $getallheaders_doc
711 "examples.setcookies" => array(
712 "function" => 'setcookies',
713 "signature" => $setcookies_sig,
714 "docstring" => $setcookies_doc
716 "examples.getcookies" => array(
717 "function" => 'getcookies',
718 "signature" => $getcookies_sig,
719 "docstring" => $getcookies_doc
721 "mail.send" => array(
722 "function" => "mail_send",
723 "signature" => $mail_send_sig,
724 "docstring" => $mail_send_doc
726 "validator1.arrayOfStructsTest" => array(
727 "function" => "v1_arrayOfStructs",
728 "signature" => $v1_arrayOfStructs_sig,
729 "docstring" => $v1_arrayOfStructs_doc
731 "validator1.easyStructTest" => array(
732 "function" => "v1_easyStruct",
733 "signature" => $v1_easyStruct_sig,
734 "docstring" => $v1_easyStruct_doc
736 "validator1.echoStructTest" => array(
737 "function" => "v1_echoStruct",
738 "signature" => $v1_echoStruct_sig,
739 "docstring" => $v1_echoStruct_doc
741 "validator1.manyTypesTest" => array(
742 "function" => "v1_manyTypes",
743 "signature" => $v1_manyTypes_sig,
744 "docstring" => $v1_manyTypes_doc
746 "validator1.moderateSizeArrayCheck" => array(
747 "function" => "v1_moderateSizeArrayCheck",
748 "signature" => $v1_moderateSizeArrayCheck_sig,
749 "docstring" => $v1_moderateSizeArrayCheck_doc
751 "validator1.simpleStructReturnTest" => array(
752 "function" => "v1_simpleStructReturn",
753 "signature" => $v1_simpleStructReturn_sig,
754 "docstring" => $v1_simpleStructReturn_doc
756 "validator1.nestedStructTest" => array(
757 "function" => "v1_nestedStruct",
758 "signature" => $v1_nestedStruct_sig,
759 "docstring" => $v1_nestedStruct_doc
761 "validator1.countTheEntities" => array(
762 "function" => "v1_countTheEntities",
763 "signature" => $v1_countTheEntities_sig,
764 "docstring" => $v1_countTheEntities_doc
766 "interopEchoTests.echoString" => array(
767 "function" => "i_echoString",
768 "signature" => $i_echoString_sig,
769 "docstring" => $i_echoString_doc
771 "interopEchoTests.echoStringArray" => array(
772 "function" => "i_echoStringArray",
773 "signature" => $i_echoStringArray_sig,
774 "docstring" => $i_echoStringArray_doc
776 "interopEchoTests.echoInteger" => array(
777 "function" => "i_echoInteger",
778 "signature" => $i_echoInteger_sig,
779 "docstring" => $i_echoInteger_doc
781 "interopEchoTests.echoIntegerArray" => array(
782 "function" => "i_echoIntegerArray",
783 "signature" => $i_echoIntegerArray_sig,
784 "docstring" => $i_echoIntegerArray_doc
786 "interopEchoTests.echoFloat" => array(
787 "function" => "i_echoFloat",
788 "signature" => $i_echoFloat_sig,
789 "docstring" => $i_echoFloat_doc
791 "interopEchoTests.echoFloatArray" => array(
792 "function" => "i_echoFloatArray",
793 "signature" => $i_echoFloatArray_sig,
794 "docstring" => $i_echoFloatArray_doc
796 "interopEchoTests.echoStruct" => array(
797 "function" => "i_echoStruct",
798 "signature" => $i_echoStruct_sig,
799 "docstring" => $i_echoStruct_doc
801 "interopEchoTests.echoStructArray" => array(
802 "function" => "i_echoStructArray",
803 "signature" => $i_echoStructArray_sig,
804 "docstring" => $i_echoStructArray_doc
806 "interopEchoTests.echoValue" => array(
807 "function" => "i_echoValue",
808 "signature" => $i_echoValue_sig,
809 "docstring" => $i_echoValue_doc
811 "interopEchoTests.echoBase64" => array(
812 "function" => "i_echoBase64",
813 "signature" => $i_echoBase64_sig,
814 "docstring" => $i_echoBase64_doc
816 "interopEchoTests.echoDate" => array(
817 "function" => "i_echoDate",
818 "signature" => $i_echoDate_sig,
819 "docstring" => $i_echoDate_doc
821 "interopEchoTests.whichToolkit" => array(
822 "function" => "i_whichToolkit",
823 "signature" => $i_whichToolkit_sig,
824 "docstring" => $i_whichToolkit_doc
829 $a['examples.php.getStateName'] = $findstate2_sig;
832 $a['examples.php2.getStateName'] = $findstate3_sig;
835 $a['examples.php3.getStateName'] = $findstate4_sig;
838 $a['examples.php4.getStateName'] = $findstate5_sig;
840 $s=new xmlrpc_server($a, false);
842 $s->compress_response = true;
844 // out-of-band information: let the client manipulate the server operations.
845 // we do this to help the testsuite script: do not reproduce in production!
846 if (isset($_GET['RESPONSE_ENCODING']))
847 $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
848 if (isset($_GET['EXCEPTION_HANDLING']))
849 $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
851 // that should do all we need!