让我们考虑'mywebsite'作为我的网站uname as username,pwd作为密码。
现在的情况是我有一个以前工作的系统,但是现在,当我试图从Odoo连接到Magento时,它会返回一个错误
<ProtocolError for mywebsite/index.php/api/xmlrpc/: 301 Moved Permanently>
但是,如果您在浏览器上击中https://mywebsite.com,则该特定URL是可获得的,并且当 Postman
击中时,也将返回真实的结果。我尝试使用Python脚本
击中相同的URLimport xmlrpclib
server = xmlrpclib.ServerProxy('https://mywebsite.com')
session = server.login('uname','pwd')
多次在多个环境中当我从托管时托管的同一环境中执行此脚本时,我会收到相同的错误
Error 301 Moved Permenantly
现在,当我从本地环境中击中上面的脚本时,我会得到
SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
我认为是由于使用 https 而产生的
xmlrpclib.ProtocolError: <ProtocolError for mywebsite.com/: 301 Moved Permanently>
从登台环境中击中上述脚本,我的结果与我的本地enviroment
相同当我更改上述脚本并使用网站的IP以及端口一起运行它时,我会得到
socket.error: [Errno 110] Connection timed out
然后我尝试更改脚本并使用此代码运行脚本
import urllib
print urllib.urlopen("http://mywebsite.com/").getcode()
当我从本地计算机运行此代码时,我会得到
Error 403 Forbidden Request
使用端口的网站IP键入此新代码
IOError: [Errno socket error] [Errno 110] Connection timed out
当我点击此代码时,没有
SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
现在使用mywebsite.com从实时环境中击中这些代码
Error 403
使用ip 没有端口
[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
ip and port
IOError: [Errno socket error] [Errno 110] Connection timed out
任何指示或建议都将不胜感激如果有愚蠢的错误,请原谅他们,因为我是Odoo/Python的业余爱好者
另外,如果您还有其他方法可以检查URL是否可击中,请让我知道
好吧,似乎当我输入odoo中的mywebsite URL时,它是由/index.php/api/xmlrpc
添加到后端的,这已经有一段时间了但是现在由于某些更改,它不再接受index.php,因为它是自动路由的(Mayb)无论如何,我通过将附加字符串更改为 /api/xmlrpc