PEARのXML_RPCを使って、RESTサーバに送信した場合どうなるか見てみた。
<?php require_once "XML/RPC.php"; $title = "KoshigoeBLOG"; $url = "http://blog.koshigoe.jp/"; $rss = "http://blog.koshigoe.jp/index.xml"; $params = array( new XML_RPC_Value("", "string"), new XML_RPC_Value("", "string"), ); $message = new XML_RPC_Message("weblogUpdates.ping", $params); $clients = array(); $server = "blogsearch.google.co.jp"; $endpoint = "http://blogsearch.google.co.jp/ping?name=" . urlencode($title) . "&url=" . urlencode($url) . "&changeURL=" . urlencode($rss); $cli = new XML_RPC_Client($endpoint, $server); $cli->setDebug(1); $clients[] = $cli; $server = "api.my.yahoo.co.jp"; $endpoint = "http://api.my.yahoo.co.jp/rss/ping?u=" . urlencode($rss); $cli = new XML_RPC_Client($endpoint, $server); $cli->setDebug(1); $clients[] = $cli; foreach ($clients as $cli) { $resp = $cli->send($message); if (!$resp) { echo 'Communication error: ' . $cli->errstr; exit; } if (!$resp->faultCode()) { $val = $resp->value(); $data = XML_RPC_decode($val); echo $data[0]['name'] . ' is at version ' . $data[0]['version']; } else { echo 'Fault Code: ' . $resp->faultCode() . "\n"; echo 'Fault Reason: ' . $resp->faultString() . "\n"; } } /** results <pre>---GOT--- HTTP/1.0 200 OK Content-Type: text/plain; charset=Shift_JIS Set-Cookie: PREF=ID=43cfaf2c8e225666:TM=1166889903:LM=1166889903:S=_ShDAUWKrIV9dhMG; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.co.jp Server: psfe Content-Length: 20 Date: Sat, 23 Dec 2006 16:05:03 GMT Connection: Keep-Alive Thanks for the ping. ---END---</pre> XML error at line 1, check URL Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload <pre>---GOT--- HTTP/1.1 200 OK Date: Sat, 23 Dec 2006 16:05:04 GMT P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Content-Length: 320 Connection: close Content-Type: text/plain Refresh requested: http://blog.koshigoe.jp/index.xml Blog Search: Successfully refresh requested My Yahoo! RSS reade: Feed not found. To request refresh, add feed to My Yahoo! About "Blog Search", see "http://blog-search.yahoo.co.jp/" About "My Yahoo! RSS reader", "http://my.yahoo.co.jp/promo_jp/rss_reader/index.html" ---END---</pre> XML error at line 1, check URL Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload **/ ?>
プログラムを正常終了出来て、pingサーバからのHTTPレスポンスもping受信完了のもの。ただ、RESTサーバからのレスポンスはtest/plainなので、XML-RPCのレスポンス処理で問題が起きる。といっても、HTTPステータスを確認して問題なかった後のXMLパーズでの問題。

