$f=new xmlrpcmsg('examples.getStateName',
array(new xmlrpcval(14, "int")));
$c=new xmlrpc_client("/RPC2", "betty.userland.com", 80);
$r=$c->send($f);
$v=$r->value();
if (!$r->faultCode()) {
print "State number ". $HTTP_POST_VARS["stateno"] . " is " .
$v->scalarval() . "<BR>";
print "<HR>I got this value back<BR><PRE>" .
htmlentities($r->serialize()). "</PRE><HR>\n";
} else {
print "Fault: ";
print "Code: " . $r->faultCode() .
" Reason '" .$r->faultString()."'<BR>";
}
?>
In the example we create a XML_RPC message to call the "examples.getStateName" method and we pass
an integer parameter of type "int" with the number 14. Then we create the RPC client indicating the
URL to call (path,domain and port). Then we send the message, receive a response object and check
for errors. If no errors are found we display the result.