3

I have a code to post data on word press i.e.-

    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);`

These same code was working 2 month but now its not working. Now when I goes to post data is showing an exception i.e.-

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'

I am using

xmlrpc-client-1.1

WordPress 3.2.1

Khoyendra Pande
  • 1,627
  • 5
  • 25
  • 42
  • 2
    Might the url you're refering to just not be available anymore? At least it looks so: `java.io.FileNotFoundException: http://www.arrestcentral.com/XMLrpc.php?` – Thomas Aug 19 '11 at 13:28
  • but this same url was working few days, we have not changed – Khoyendra Pande Aug 19 '11 at 13:32
  • Still the URL might be down - maybe temporarily. Alternatively, your connection might not be working, maybe a proxy is blocking it. If you didn't change the code and it used to run, check what else might have changed. – Thomas Aug 19 '11 at 13:34
  • http://www.arrestcentral.com/ is the main url and because we are using "xmlrpc-client-1.1" api's jar so we added "XMLrpc.php" after main url – Khoyendra Pande Aug 19 '11 at 13:41
  • Are you sure `XMLrpc.php` is still hosted by that server? You should confirm that first and second check your connection (network settings). – Thomas Aug 19 '11 at 13:44
  • its running in server so we not need to check connection – Khoyendra Pande Aug 19 '11 at 14:02
  • 1
    Try to remove the question-mark and write the filename in lowercase so that your URL looks like this: `http://www.arrestcentral.com/xmlrpc.php`. Webservers are case-sensitive! – Pit Aug 19 '11 at 18:07
  • I have tried without "?" too but still not working. – Khoyendra Pande Aug 19 '11 at 18:25

1 Answers1

1

http://www.arrestcentral.com/XMLrpc.php (as displayed in the stack trace) does not exist and returns a 404 error. Put that URL into your browser and you will see. This is exactly what you would expect.

http://www.arrestcentral.com/xmlrpc.php on the other hand does exist, and if you request it with no parameters you will get back:

XML-RPC server accepts POST requests only.

You need to use the correct url (http://www.arrestcentral.com/xmlrpc.php) without a trailing question mark:

String xmlRpcUrl = "http://www.arrestcentral.com/xmlrpc.php";
Brian Roach
  • 76,169
  • 12
  • 136
  • 161