2011-08-19 29 views
3

我有一個代碼張貼在字按數據i.e.-獲得一個例外在WordPress後

String username = "xyz"; 
    String password = "xyz"; 
    String xmlRpcUrl = "http://www.arrestcentral.com/xmlrpc.php?"; 
    Wordpress wp = new Wordpress(username, password, xmlRpcUrl); 
    Page recentPost = new Page(); 
    String result = wp.newPost(recentPost, true);` 

這些相同的代碼在第2工作一個月,但現在它不工作。 現在,當我去發佈數據顯示,我使用IE-

redstone.xmlrpc.XmlRpcException: The response could not be parsed. 

at redstone.xmlrpc.XmlRpcClient.handleResponse(Unknown Source) 
at redstone.xmlrpc.XmlRpcClient.endCall(Unknown Source) 
at redstone.xmlrpc.XmlRpcClient.invoke(Unknown Source) 
at redstone.xmlrpc.XmlRpcProxy.invoke(Unknown Source) 
at net.bican.wordpress.$Proxy1.newMediaObject(Unknown Source) 
at net.bican.wordpress.Wordpress.newMediaObject(Wordpress.java:582) 
at WordpressPost.DataWordpressPost.DataPost(DataWordpressPost.java:53) 
at arrestcentral.ArrestData.readPdf(ArrestData.java:420) 
at arrestcentral.ArrestData.main(ArrestData.java:447) 
Caused by: java.io.FileNotFoundException: http://www.arrestcentral.com/XMLrpc.php? 
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1478) 
... 9 more' 

異常

中顯示XML-RPC客戶端 - 1.1

的WordPress 3.2.1

+2

可能是您所指的網址不再可用?至少它看起來是這樣的:'java.io.FileNotFoundException:http://www.arrestcentral.com/XMLrpc.php? – Thomas

+0

但這個相同的網址工作了幾天,我們沒有改變 –

+0

仍然URL可能被關閉 - 也許暫時。或者,您的連接可能無法正常工作,也可能是代理阻止了它。如果您沒有更改代碼並且它曾經運行過,請檢查可能發生了什麼變化。 – Thomas

回答

1

http://www.arrestcentral.com/XMLrpc.php(堆棧跟蹤)確實存在而不是,並返回404錯誤。將該URL放入瀏覽器中,您會看到。這正是你所期望的。

http://www.arrestcentral.com/xmlrpc.php,另一方面確實存在的,如果你不帶參數要求它,你將得到的結果:

XML-RPC server accepts POST requests only. 

您需要使用正確的URL(http://www.arrestcentral.com/xmlrpc.php沒有拖尾問題mark:

String xmlRpcUrl = "http://www.arrestcentral.com/xmlrpc.php";