2 <head><title>xmlrpc</title></head>
7 $f = new xmlrpcmsg('examples.getStateName');
9 print "<h3>Testing value serialization</h3>\n";
11 $v = new xmlrpcval(23, "int");
12 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
13 $v = new xmlrpcval("What are you saying? >> << &&");
14 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
16 $v = new xmlrpcval(array(
17 new xmlrpcval("ABCDEFHIJ"),
18 new xmlrpcval(1234, 'int'),
19 new xmlrpcval(1, 'boolean')),
23 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
27 "thearray" => new xmlrpcval(
29 new xmlrpcval("ABCDEFHIJ"),
30 new xmlrpcval(1234, 'int'),
31 new xmlrpcval(1, 'boolean'),
32 new xmlrpcval(0, 'boolean'),
33 new xmlrpcval(true, 'boolean'),
34 new xmlrpcval(false, 'boolean')
38 "theint" => new xmlrpcval(23, 'int'),
39 "thestring" => new xmlrpcval("foobarwhizz"),
40 "thestruct" => new xmlrpcval(
42 "one" => new xmlrpcval(1, 'int'),
43 "two" => new xmlrpcval(2, 'int')
51 print "<PRE>" . htmlentities($v->serialize()) . "</PRE>";
53 $w = new xmlrpcval(array($v, new xmlrpcval("That was the struct!")), "array");
55 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
57 $w = new xmlrpcval("Mary had a little lamb,
58 Whose fleece was white as snow,
59 And everywhere that Mary went
60 the lamb was sure to go.
62 Mary had a little lamb
63 She tied it to a pylon
64 Ten thousand volts went down its back
65 And turned it into nylon", "base64"
67 print "<PRE>" . htmlentities($w->serialize()) . "</PRE>";
68 print "<PRE>Value of base64 string is: '" . $w->scalarval() . "'</PRE>";
71 $f->addParam(new xmlrpcval("41", "int"));
73 print "<h3>Testing request serialization</h3>\n";
74 $op = $f->serialize();
75 print "<PRE>" . htmlentities($op) . "</PRE>";
77 print "<h3>Testing ISO date format</h3><pre>\n";
80 $date = iso8601_encode($t);
81 print "Now is $t --> $date\n";
82 print "Or in UTC, that is " . iso8601_encode($t, 1) . "\n";
83 $tb = iso8601_decode($date);
84 print "That is to say $date --> $tb\n";
85 print "Which comes out at " . iso8601_encode($tb) . "\n";
86 print "Which was the time in UTC at " . iso8601_decode($date, 1) . "\n";