1

I trying to post a simple blog-post to a drupal-site with xml-rpc. I use the IXR_Library for this.

Here is my example-code using metaWeblog.newPost:

$url = 'http://drupalpage.de/xmlrpc.php';
$user = 'drupaluser';
$pass = 'drupalpass';

$post = array(
            'title' => 'New Title'
            'description' => 'Some content…'
);

$IXR = new IXR_Client($url);

$status = $IXR->query('metaWeblog.newPost', 
'1',
            $user,
            $pass,
            $post,
            true
        );

When I call this script I get the following return from drupal:

[params] => Array
                (
                    [0] => Array
                        (
                            [faultCode] => 1
                            [faultString] => Entweder versuchten Sie einen fremden Blog zu editieren oder Sie haben keine Berechtigung Ihren eigenen Blog zu editieren.
                        )

                )

I don’t know why I get this „permission-notice“ from the drupal-system. I can login to the system with exactly the value in the variables $user/$pass.

Some more infos: When I call ‘system.listMethods’ I get the following return:

[0] => Array
(
    [0] => system.multicall
    [1] => system.methodSignature
    [2] => system.getCapabilities
    [3] => system.listMethods
    [4] => system.methodHelp
    [5] => blogger.getUsersBlogs
    [6] => blogger.getUserInfo
    [7] => blogger.newPost
    [8] => blogger.editPost
    [9] => blogger.getPost
    [10] => blogger.deletePost
    [11] => blogger.getRecentPosts
    [12] => metaWeblog.newPost
    [13] => metaWeblog.editPost
    [14] => metaWeblog.getPost
    [15] => metaWeblog.newMediaObject
    [16] => metaWeblog.getCategories
    [17] => metaWeblog.getRecentPosts
    [18] => mt.getRecentPostTitles
    [19] => mt.getCategoryList
    [20] => mt.getPostCategories
    [21] => mt.setPostCategories
    [22] => mt.supportedMethods
    [23] => mt.supportedTextFilters
    [24] => mt.getTrackbackPings
    [25] => mt.publishPost
)

When I call ‘metaWeblog.getCategories’ I get a correct return-array with the categories from the drupal-system.

I tried a lot of other variants to solve my problem. But when I call ‘blogger.getUsersBlogs’ or ‘blogger.getUserInfo’ I get the same permission-notice.

Does anyone know what I'm doing wrong?

iparker
  • 51
  • 2
  • I tried to login with the firefox-addon scribefire to the drupal-system and i get the same error. I don't get it why this not works... – iparker Oct 06 '11 at 11:03
  • I think i solved a part of the problem: The error was, that the blod_id has the string-value '1'. In the drupal-system the blog_id has to be the string 'blog' (in contrast to wordpress-systems where the 1 is correct). But in some cases I still get the same error... – iparker Oct 07 '11 at 05:31

0 Answers0