Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Error while trying to connect to XML RPC [SOLVED]

By
E.M.
on 12/23/15, 4:39 PM 1,811 views

I am learning how to use XML RPC, however I am not even able to pass the basic connectivity test.

Any help is really welcomed:

# python
Python 2.7.3 (default, Jun 22 2015, 19:33:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> info = xmlrpclib.ServerProxy('http://localhost:8069').start()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1321, in single_request
response.msg,
xmlrpclib.ProtocolError: <ProtocolError for localhost:8069/RPC2: 404 NOT FOUND>
>>>


Regarding open ports:

# netstat -ta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost.localdom:8069 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost.lo:postgresql *:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN

 


2
E.M.
On 12/23/15, 4:52 PM

Already found the answer by rereading the docs:

# cat testrpc2.py
import xmlrpclib
url = 'http://localhost:8069'
db = 'mydb1'
username = 'admin'
password = 'xxxxxxxx'
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
output = common.version()
print output
# python testrpc2.py
{'server_version_info': [8, 0, 0, 'final', 0], 'server_serie': '8.0', 'server_version': '8.0-20150726', 'protocol_version': 1}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/23/15, 4:39 PM
Seen: 1811 times
Last updated: 8/19/16, 4:54 PM