• I just trying to access the wordpress API using a PHP library and something like this:

    =============================================================
    include(“IXR_Library.inc.php”);
    $client = new IXR_Client(‘http://myserver.dev/wordpress/xmlrpc.php’);
    if (!$client->query(‘wp.getPages’,’admin’,’admin’)) {
    die(‘An error occurred – ‘.$client->getErrorCode().”:”.$client->getErrorMessage());
    }
    print $client->getResponse();
    ===============================================================
    The respond I got is:
    “An error occurred – 403:Bad login/pass combination.”

    These are the admin user/pass Im using. I tried the encoded password too with the same result.

    My questions:
    -How can I implement the request?
    -If I implement a plugin/application there is a secure way to get that user/password form the database.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Check the xmlrpc.php file for function interfaces.

    wp.getPages requires “blog_id” as the first parameter. What you do is passing “admin” user with blank password.

    Thread Starter alaingg

    (@alaingg)

    Yes, I just get the $blog_id=1 (for wordpressMU It can be different).

    This works.
    $client->query(‘wp.getPages’,’1′,’admin’,’admin’)

    Thank you.

    Is the IXR_Client class what everyone seems to use as their PHP RPCXML class of choice? I’ve been looking around for libraries to use and haven’t really found any except this and one from DentedReality (http://dentedreality.com.au/projects/phpbloggerapi/class/) – I am probably using the wrong search criteria.

    Is anyone aware of a PHP5 based implementation similar to Simon Willison’s?

    You can still use IXR on PHP5.

    Thank you, Joseph. As the IXR_Client was bundled with WordPress, I figured it was more well-supported by WordPress itself and went with it. I was able to query the categories with the wp_getCategories XMLRPC method, but had issue with the mw_newPost method. I’d like to learn more about these protocols but it’s difficult to find information that’s not outdated or no longer on the web.

    I think I’ll try the mailing list.

    Hmm… Programmer’s error, I forgot to update the variable name in the procedure call when I updated it in the earlier code.

    I may still try the mailing list in the future. If I simply have newbie questions over protocols, such as ATOM, should I message the wp-xmlrpc list or the wp-hackers list? It looks like the xmlrpc list is more for WordPress developers and hardcore blogging applications developers to communicate. (Here’s hoping you come back to view this message.)

    If it’s about AtomPub or XML-RPC I’d suggest the wp-xmlrpc email list. There are XML-RPC client devs on there as well, which is good because they’ve had lots of experience dealing with various quirks.

    Thanks Joseph!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘XMLRPC client’ is closed to new replies.