Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3051 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

Thank you very much it's working

Post Terkait Replies Tampilan Aktivitas
0
Agu 21
2209
1
Mar 21
11364
1
Jul 24
2886
1
Des 22
2052
1
Mei 22
2430