OSDN Git Service

merged 3.15rc3 modification
[nucleus-jp/nucleus-jp-ancient.git] / euc / build / testcases / xmlrpc-mt-setPostCategories.php
1 <?php\r
2 /*\r
3         Test call to the nucleus XML-RPC server sending a mt.setPostCategories request\r
4         \r
5         Wouter Demuynck / 2003-09-01\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         'mt.setPostCategories',\r
18          array(\r
19                 new xmlrpcval('2', 'string'),                   // itemid\r
20                 new xmlrpcval('god', 'string'),                 // username\r
21                 new xmlrpcval('heaven', 'string'),              // password\r
22                 new xmlrpcval(\r
23                         array(                                  \r
24                                 new xmlrpcval(\r
25                                         array(\r
26                                                 'categoryId' => new xmlrpcval('Test','string')\r
27                                         ),\r
28                                         'struct'\r
29                                 )\r
30 /*                              ,\r
31                                 new xmlrpcval(\r
32                                         array(\r
33 //                                              'isPrimary' => new xmlrpcval(1, 'boolean'),\r
34                                                 'categoryId' => new xmlrpcval('newcat1','string')\r
35                                         ),\r
36                                         'struct'\r
37                                 ),\r
38                                 new xmlrpcval(\r
39                                         array(\r
40                                                 'categoryId' => new xmlrpcval('General','string')\r
41                                         ),\r
42                                         'struct'\r
43                                 )                       \r
44 */                              \r
45                         ),              \r
46                         'array'\r
47                 )\r
48          )\r
49  );\r
50          \r
51         echo 'ready';\r
52   $c=new xmlrpc_client($serverPath, $serverHost, $serverPort);\r
53   $c->setDebug(1);\r
54   $r=$c->send($f);\r
55   $v=$r->value();\r
56 \r
57 \r
58   if (!$r->faultCode()) {\r
59         echo 'succes!';\r
60   } else {\r
61       print "Fault: ";\r
62       print "Code: " . $r->faultCode() . \r
63             " Reason '" .$r->faultString()."'<BR>";\r
64   }\r
65         \r
66 \r
67         \r
68 ?>