2 <head><title>xmlrpc - Zope test demo</title></head>
4 <h1>Zope test demo</h1>
6 <h3>The code demonstrates usage of basic authentication to connect to the server</h3>
9 include_once __DIR__ . "/../../src/Autoloader.php";
10 PhpXmlRpc\Autoloader::register();
12 $req = new PhpXmlRpc\Request('document_src', array());
13 $client = new PhpXmlRpc\Client("pingu.heddley.com:9080/index_html");
14 $client->setCredentials("username", "password");
16 $resp = $client->send($req);
17 if (!$resp->faultCode()) {
18 $value = $resp->value();
19 print "I received:" . htmlspecialchars($value->scalarval()) . "<br/>";
20 print "<hr/>I got this value back<br/>pre>" .
21 htmlentities($resp->serialize()) . "</pre>\n";
23 print "An error occurred: ";
24 print "Code: " . htmlspecialchars($resp->faultCode())
25 . " Reason: '" . ($resp->faultString()) . "'<br/>";