Skip to Content
Menu
This question has been flagged
1 Reply
10323 Views

please help for External API, i am following guide lines from here:

https://www.odoo.com/documentation/14.0/webservices/odoo.html

wrote the .py file as below:

url = "127.0.0.1:8069"
db = 'odb14'
username = 'admin'
password = 'admin'
import xmlrpc.client
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
version = common.version()
print("details....", version)

when run it returns OSError: unsupported XML-RPC protocol ( my OS is Ubuntu 18.05 )

odoo@ubuntu:~/odoo-dev/odoo$ python3.6 -m odoo_webservice
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/odoo/odoo-dev/odoo/odoo_webservice.py", line 8, in <module>
    common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1418, in __init__
    raise OSError("unsupported XML-RPC protocol")
OSError: unsupported XML-RPC protocol

Avatar
Discard
Author Best Answer

solved, the code below works fine, thanks to Daniel Ries author of Odoo Development Cookbook 

url = 'http://localhost:8069'
db = 'odb14'
username = 'admin'
password = 'admin'
import xmlrpc.client

common = xmlrpc.client.ServerProxy('%s/xmlrpc/2/common' % url)
version = common.version()
print("details...", version)
Avatar
Discard
Related Posts Replies Views Activity
0
Aug 21
1891
1
May 22
2124
1
Jan 23
713
0
Sep 21
1057
0
Jul 21
3694