2 <head><title>xmlrpc</title></head>
5 include_once __DIR__ . "/../vendor/autoload.php";
7 include_once __DIR__ . "/../lib/xmlrpc.inc";
9 $f = new xmlrpcmsg('examples.getStateName');
11 print "<h3>Testing value serialization</h3>\n";
13 $v = new xmlrpcval(23, "int");
14 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
15 $v = new xmlrpcval("What are you saying? >> << &&");
16 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
18 $v = new xmlrpcval(array(
19 new xmlrpcval("ABCDEFHIJ"),
20 new xmlrpcval(1234, 'int'),
21 new xmlrpcval(1, 'boolean'),),
25 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
29 "thearray" => new xmlrpcval(
31 new xmlrpcval("ABCDEFHIJ"),
32 new xmlrpcval(1234, 'int'),
33 new xmlrpcval(1, 'boolean'),
34 new xmlrpcval(0, 'boolean'),
35 new xmlrpcval(true, 'boolean'),
36 new xmlrpcval(false, 'boolean'),
40 "theint" => new xmlrpcval(23, 'int'),
41 "thestring" => new xmlrpcval("foobarwhizz"),
42 "thestruct" => new xmlrpcval(
44 "one" => new xmlrpcval(1, 'int'),
45 "two" => new xmlrpcval(2, 'int'),
53 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
55 $w = new xmlrpcval(array($v, new xmlrpcval("That was the struct!")), "array");
57 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
59 $w = new xmlrpcval("Mary had a little lamb,
60 Whose fleece was white as snow,
61 And everywhere that Mary went
62 the lamb was sure to go.
64 Mary had a little lamb
65 She tied it to a pylon
66 Ten thousand volts went down its back
67 And turned it into nylon", "base64"
69 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
70 print "<PRE>Value of base64 string is: '" . $w->scalarval() . "'</PRE>";
73 $f->addParam(new xmlrpcval("41", "int"));
75 print "<h3>Testing request serialization</h3>\n";
76 $op = $f->serialize();
77 print "<PRE>" . htmlentities($op) . "</PRE>";
79 print "<h3>Testing ISO date format</h3><pre>\n";
82 $date = iso8601_encode($t);
83 print "Now is $t --> $date\n";
84 print "Or in UTC, that is " . iso8601_encode($t, 1) . "\n";
85 $tb = iso8601_decode($date);
86 print "That is to say $date --> $tb\n";
87 print "Which comes out at " . iso8601_encode($tb) . "\n";
88 print "Which was the time in UTC at " . iso8601_decode($date, 1) . "\n";