Skip to Content
Menu
This question has been flagged

I have a Python file that contains code from an external API

When executed, it produces the following error



C:\Users\PC\Documents>python -m web_service.py

Traceback (most recent call last):

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 185, in _run_module_as_main

mod_name, mod_spec, code = _get_module_details(mod_name, _Error)

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 111, in _get_module_details

__import__(pkg_name)

File "C:\Users\PC\Documents\web_service.py", line 8, in

ver = common.version()

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\xmlrpc\client.py", line 1109, in __call__

return self.__send(self.__name, args)

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\xmlrpc\client.py", line 1450, in __request

response = self.__transport.request(

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\xmlrpc\client.py", line 1153, in request

return self.single_request(host, handler, request_body, verbose)

File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\xmlrpc\client.py", line 1183, in single_request
raise ProtocolError(

xmlrpc.client.ProtocolError:
ProtocolError for localhost:8069//xmlrpc/2/common: 404 NOT FOUND

this is the code :

importxmlrpc.client
url = 'http://localhost:8069/'
db = 'arados'
username = 'admin'
password = 'admin'
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
ver = common.version()
print('details *********', ver)


any help ??
Avatar
Discard
Best Answer

Hi Ali,

Please try by removing "/" added at the end of the url variable,

Try this: url = 'http://localhost:8069'


For more details refer this video:Odoo External API


Thank you

Avatar
Discard
Author

Thank you very much it's working

Related Posts Replies Views Activity
0
Aug 21
1896
1
Mar 21
10339
1
Jul 24
1999
1
Dec 22
1384
1
May 22
2125