Forums

XML-RPC password failuer (3 posts)

  1. ruturajv
    Member
    Posted 2 years ago #

    I've installed a local version of WP, for creating a project, when I'm working on XML-RPC I get password err.

    POST /ruturaj/wordpress/xmlrpc.php HTTP/1.0
    Host: 10.90.21.156
    Content-Type: text/xml
    User-Agent: The Incutio XML-RPC PHP Library
    Content-length: 378
    
    <?xml version="1.0"?>
    <methodCall>
    <methodName>wp.getComments</methodName>
    <params>
    <param><value><struct>
      <member><name>blog_id</name><value><int>1</int></value></member>
      <member><name>username</name><value><string>admin</string></value></member>
      <member><name>password</name><value><string>admin</string></value></member>
    </struct></value></param>
    </params></methodCall>
    
    <?xml version="1.0"?>
    <methodResponse>
    <fault>
    <value>
    <struct>
    <member>
    <name>faultCode</name>
    <value><int>403</int></value>
    </member>
    <member>
    <name>faultString</name>
    <value><string>Bad login/pass combination.</string></value>
    </member>
    </struct>
    </value>
    </fault>
    </methodResponse>

    The username and password work while logging through wp-admin. Any ideas what is the error. My script is simple as follows

    <?php
    include 'ixr.php';
    
    $client = new IXR_Client('http://10.90.21.156/ruturaj/wordpress/xmlrpc.php');
    $client->debug = true;
    
    $parameters = array(
    	'blog_id' => 1,
    	'username' => 'admin',
    	'password' => 'admin',
    );
    
    $client->query('wp.getComments', $parameters);
    
    print $client->getResponse;
  2. ruturajv
    Member
    Posted 2 years ago #

    I found this.. as working expample

    <?php
    include 'ixr.php';
    
    $client = new IXR_Client('http://10.90.21.156/ruturaj/wordpress/xmlrpc.php');
    $client->debug = true;
    
    $client->query('wp.getComments',
    	1,
    	'admin',
    	'admin'
    );
    
    print $client->getResponse;
  3. Joseph Scott
    Member
    Posted 2 years ago #

    You were wrapping the username/password information as a struct. They are first class parameters for the method call, no need to wrap them in the struct.

Topic Closed

This topic has been closed to new replies.

About this Topic