我正在使用 wordpress-java (http://code.google.com/p/wordpress-java/) 在我的博客中创建一个测试帖子,但出现异常:
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.newPost(Unknown Source)
at net.bican.wordpress.Wordpress.newPost(Wordpress.java:606)
at Ienmx.<init>(Ienmx.java:39)
at Pulso.obtenerMinutoAMinuto(Pulso.java:68)
at principal$1.run(principal.java:24)
at java.util.TimerThread.mainLoop(Timer.java:534)
at java.util.TimerThread.run(Timer.java:484)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://pulso.wpengine.com/xmlrpc.php
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1403)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
... 11 more
这是我的代码:
this.w = new Wordpress(usuario, password, xmlUrl);
Page p = new Page();
p.setTitle("Se crea el objeto en el script");
p.setDescription("Este es el cuerpo del post");
try{
w.newPost(p, true);
}catch(Exception e){
e.printStackTrace();
System.out.println(e.getMessage());
}
如果您转到 url,则 url 显示经典消息:
XML-RPC 服务器只接受 POST 请求。
我不知道出了什么问题:(
谢谢 :)