3 include_once("./config.php"); // include Nucleus libs and code
4 include_once($DIR_LIBS . "xmlrpc.inc.php");
5 $xmlrpc_internalencoding = _CHARSET;
6 $xmlrpc_defencoding = 'UTF-8';
12 <title>XML-RPC(PHP) Client Demo</title>
13 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />
16 <h1>XML-RPC(PHP) Client Demo</h1>
20 $xmlrpc_host = "your host name"; // Nucleus を設置しているサーバのホスト名
21 $xmlrpc_path = "/?action=plugin&name=UodatePingServer&type=updateping"; // pingサーバスクリプトのパス
22 // $xmlrpc_path = "/RPCS"; // .htaccess を設定している時はこっち
23 $c = new xmlrpc_client( $xmlrpc_path, $xmlrpc_host, 80 );
24 // $c->setDebug(1); // デバッグモードを有効にする場合はアンコメント
27 $message = new xmlrpcmsg(
28 'weblogUpdates.ping', // pingメソッドの選択
29 // 'weblogUpdates.extendedPing', // pingメソッドの選択
31 new xmlrpcval('your weblog title'), // ブログのタイトル
32 new xmlrpcval('http://your.nucleus.url/path/'), // ブログのURL
33 // new xmlrpcval('http://your.nucleus.url/path/to/contents/'), // 変更があったコンテンツのURL(空白でも可)
34 // new xmlrpcval('http://your.nucleus.url/path/to/feed.xml'), // RSSやAtom等のURL
37 /******* メソッドに weblogUpdates.extendedPing を指定した場合は、3、4番目が必須になります ******/
40 $response = $c->send($message);
42 // Process the response.
43 if (!$response->faultCode()) {
44 $struct = $response->value();
45 $resultval = $struct->structmem('message');
46 echo "Value: ".$resultval->scalarval();
47 echo "The XML received:<pre>" . htmlspecialchars($response->serialize());
51 echo "Fault Code: " . $response->faultCode() . "<br>";
52 echo "Fault Reason: " . $response->faultString() . "<br>";
53 echo "The XML received:<pre>" . htmlspecialchars($response->serialize());