发出WSDL请求,获取连接错误:('连接中止。',错误(54,'通过对等方重置连接'))

时间:2017-05-02 00:21:47

标签: python soap wsdl

我正在请求:https://test.mycardstorage.com/api/api.asmx?wsdl

wsdl ='https://test.mycardstorage.com/api/api.asmx?wsdl' client = Client(wsdl = wsdl)

但是,我收到以下错误: requests.exceptions.ConnectionError :('Connection aborted。',error(54,'peer reset by peer'))

我使用过Zeep库,下面正在尝试使用Suds。

from suds.client import Client    
client = Client('https://test.mycardstorage.com/api/api.asmx?wsdl')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/suds/client.py", line 115, in __init__
self.wsdl = reader.open(url)
File "/Library/Python/2.7/site-packages/suds/reader.py", line 150, in open
d = self.fn(url, self.options)
File "/Library/Python/2.7/site-packages/suds/wsdl.py", line 136, in __init__
d = reader.open(url)
File "/Library/Python/2.7/site-packages/suds/reader.py", line 74, in open
d = self.download(url)
File "/Library/Python/2.7/site-packages/suds/reader.py", line 92, in download
fp = self.options.transport.open(Request(url))
File "/Library/Python/2.7/site-packages/suds/transport/https.py", line 62, in open
return HttpTransport.open(self, request)
File "/Library/Python/2.7/site-packages/suds/transport/http.py", line 67, in open
return self.u2open(u2request)
File "/Library/Python/2.7/site-packages/suds/transport/http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 54] Connection reset by peer>

1 个答案:

答案 0 :(得分:0)

必须升级到python 2.7.13

还必须安装请求[安全]