OSDN Git Service

60fdc5e02e157b648924d6267de81b4a80fb3d24
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / build / testcases / xmlrpc-metaWeblog-getRecentPosts.php
1 <?php\r
2 /*\r
3         Test call to the nucleus XML-RPC server sending a metaWeblog.getRecentPosts request\r
4         \r
5         Wouter Demuynck / 2003-08-31\r
6 */\r
7 \r
8 // URL of XML-RPC server\r
9 $serverHost = 'localhost';\r
10 $serverPort = 8080;\r
11 $serverPath = '/nucleus/nucleus/xmlrpc/server.php';\r
12         \r
13 include('../../config.php');\r
14 include($DIR_LIBS . 'xmlrpc.inc.php');\r
15 \r
16 $f=new xmlrpcmsg(\r
17         'metaWeblog.getRecentPosts',\r
18          array(\r
19                 new xmlrpcval('1', 'string'),                   // blogid\r
20                 new xmlrpcval('god', 'string'),                 // username\r
21                 new xmlrpcval('heaven', 'string'),              // password\r
22                 new xmlrpcval('5', 'int')                       // amount to get\r
23          )\r
24  );\r
25          \r
26 \r
27   $c=new xmlrpc_client($serverPath, $serverHost, $serverPort);\r
28   $c->setDebug(1);\r
29   $r=$c->send($f);\r
30   $v=$r->value();\r
31 \r
32 \r
33   if (!$r->faultCode()) {\r
34         echo 'success!';\r
35   } else {\r
36       print "Fault: ";\r
37       print "Code: " . $r->faultCode() . \r
38             " Reason '" .$r->faultString()."'<BR>";\r
39   }\r
40         \r
41 \r
42         \r
43 ?>