تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3119 أدوات العرض

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 ??
الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب

Thank you very much it's working

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أغسطس 21
2235
1
مارس 21
11469
1
يوليو 24
3036
1
ديسمبر 22
2115
1
مايو 22
2470