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
Comment #1
kylebrowning commentedDont use anything from github, use the cvs snapshot here on the services page.
If this is still an issue, re-open this ticket.
Comment #2
rmh3093 commentedI get this error in D6 and D7 using both the beta and dev releases of this module!
Comment #3
kylebrowning commentedCan 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?
Comment #4
kylebrowning commentedComment #5
danielbeeke2 commentedHey,
I worked it out, works fine now, I down graded all services modules to the 2.0 branch