Chapter 11. Examples

Table of Contents

XML-RPC client: state name query
Executing a multicall call

The best examples are to be found in the sample files included with the distribution. Some are included here.

XML-RPC client: state name query

Code to get the corresponding state name from a number (1-50) from the demo server available on SourceForge

  $m = new xmlrpcmsg('examples.getStateName',
xmlrpcval($HTTP_POST_VARS["stateno"], "int")));
$c = new xmlrpc_client("/server.php"""80);
$r $c->send($m);
  if (!
$r->faultCode()) {
$v $r->value();
"State number " htmlentities($HTTP_POST_VARS["stateno"]) . " is " .
htmlentities($v->scalarval()) . "<BR>";
"<HR>I got this value back<BR><PRE>" .
htmlentities($r->serialize()) . "</PRE><HR>\n";
  } else {
"Fault <BR>";
"Code: " htmlentities($r->faultCode()) . "<BR>" .
"Reason: '" htmlentities($r->faultString()) . "'<BR>";