1 <?php require_once __DIR__ . "/client/_prepend.php"; ?><html lang="en">
2 <head><title>xmlrpc</title></head>
6 $req = new PhpXmlRpc\Request('examples.getStateName');
8 print "<h3>Testing value serialization</h3>\n";
10 $v = new PhpXmlRpc\Value(23, "int");
11 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
12 $v = new PhpXmlRpc\Value("What are you saying? >> << &&");
13 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
15 $v = new PhpXmlRpc\Value(
17 new PhpXmlRpc\Value("ABCDEFHIJ"),
18 new PhpXmlRpc\Value(1234, 'int'),
19 new PhpXmlRpc\Value(1, 'boolean'),
24 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
26 $v = new PhpXmlRpc\Value(
28 "thearray" => new PhpXmlRpc\Value(
30 new PhpXmlRpc\Value("ABCDEFHIJ"),
31 new PhpXmlRpc\Value(1234, 'int'),
32 new PhpXmlRpc\Value(1, 'boolean'),
33 new PhpXmlRpc\Value(0, 'boolean'),
34 new PhpXmlRpc\Value(true, 'boolean'),
35 new PhpXmlRpc\Value(false, 'boolean'),
39 "theint" => new PhpXmlRpc\Value(23, 'int'),
40 "thestring" => new PhpXmlRpc\Value("foobarwhizz"),
41 "thestruct" => new PhpXmlRpc\Value(
43 "one" => new PhpXmlRpc\Value(1, 'int'),
44 "two" => new PhpXmlRpc\Value(2, 'int'),
52 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
54 $w = new PhpXmlRpc\Value(array($v, new PhpXmlRpc\Value("That was the struct!")), "array");
56 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
58 $w = new PhpXmlRpc\Value("Mary had a little lamb,
59 Whose fleece was white as snow,
60 And everywhere that Mary went
61 the lamb was sure to go.
63 Mary had a little lamb
64 She tied it to a pylon
65 Ten thousand volts went down its back
66 And turned it into nylon", "base64"
68 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
69 print "<PRE>Value of base64 string is: '" . $w->scalarval() . "'</PRE>";
72 $req->addParam(new PhpXmlRpc\Value("41", "int"));
74 print "<h3>Testing request serialization</h3>\n";
75 $op = $req->serialize();
76 print "<PRE>" . htmlentities($op) . "</PRE>";
78 print "<h3>Testing ISO date format</h3><pre>\n";
81 $date = PhpXmlRpc\Helper\Date::iso8601Encode($t);
82 print "Now is $t --> $date\n";
83 print "Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n";
84 $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date);
85 print "That is to say $date --> $tb\n";
86 print "Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n";
87 print "Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n";
93 </html><?php require_once __DIR__ . "/client/_append.php"; ?>