Webservice wrappper demo

Wrap methods exposed by server into php functions

The code demonstrates usage of some the most automagic client usage possible:
1) client that returns php values instead of xmlrpc value objects
2) wrapping of remote methods into php functions
See also proxy.php for an alternative take

return_type = 'phpvals'; // let client give us back php values instead of xmlrpcvals $resp = $client->send(new PhpXmlRpc\Request('system.listMethods')); if ($resp->faultCode()) { echo "

Server methods list could not be retrieved: error {$resp->faultCode()} '" . htmlspecialchars($resp->faultString()) . "'

\n"; } else { echo "

Server methods list retrieved, now wrapping it up...

\n\n"; flush(); if ($callable) { echo "Now testing function for remote method to convert U.S. state number into state name"; $stateNum = rand(1, 51); // the 2nd parameter gets added to the closure - it is teh debug level to be used for the client $stateName = $callable($stateNum, 2); } } ?>