I'm trying to connect to a services xml rpc endpoint with python

#! /usr/bin/python

import os.path, sys, time, mimetypes, xmlrpclib, pprint, base64
pp = pprint.PrettyPrinter()

config = {
  'url': 'http://loggd.ducis.nl/api',
  'username': 'admin',
  'password': '[hidden]',
}

# Make initial connection to service, then login as developer
server = xmlrpclib.Server(config['url'], allow_none=True);
connection = server.system.action_connect();
session = server.user.login(config['username'], config['password']);
sessid = session['sessid'];
user = session['user'];

I am using the newest services 6.3 from github

the error returned is

Traceback (most recent call last):
  File "savenode.py", line 14, in <module>
    connection = server.system.action_connect();
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1243, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for loggd.ducis.nl/api: 401 Unauthorized: Access denied for user 0 "anonymous">

Comments

kylebrowning’s picture

Status: Active » Closed (cannot reproduce)

Dont use anything from github, use the cvs snapshot here on the services page.

If this is still an issue, re-open this ticket.

rmh3093’s picture

Category: support » bug
Status: Closed (cannot reproduce) » Active

I get this error in D6 and D7 using both the beta and dev releases of this module!

kylebrowning’s picture

Can you be more specific about which method you are calling? What use you ae using? WHat your permissions are set to for this method. etc?

kylebrowning’s picture

Status: Active » Closed (cannot reproduce)
danielbeeke2’s picture

Hey,

I worked it out, works fine now, I down graded all services modules to the 2.0 branch