【发布时间】:2016-10-04 06:13:58
【问题描述】:
我正在尝试使用 suds 包连接到 Web 服务,但出现 TransportError,我做错了什么?
from suds.client import Client
wsdl_url = 'https://sep.shaparak.ir/payments/referencepayment.asmx?WSDL'
client = Client(wsdl_url)
这是我得到的错误:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\suds\transport\http.py", line 67, in open
return self.u2open(u2request)
File "C:\Python34\lib\site-packages\suds\transport\http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "C:\Python34\lib\urllib\request.py", line 469, in open
response = meth(req, response)
File "C:\Python34\lib\urllib\request.py", line 579, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python34\lib\urllib\request.py", line 507, in error
return self._call_chain(*args)
File "C:\Python34\lib\urllib\request.py", line 441, in _call_chain
result = func(*args)
File "C:\Python34\lib\urllib\request.py", line 587, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\suds\client.py", line 115, in __init__
self.wsdl = reader.open(url)
File "C:\Python34\lib\site-packages\suds\reader.py", line 150, in open
d = self.fn(url, self.options)
File "C:\Python34\lib\site-packages\suds\wsdl.py", line 136, in __init__
d = reader.open(url)
File "C:\Python34\lib\site-packages\suds\reader.py", line 74, in open
d = self.download(url)
File "C:\Python34\lib\site-packages\suds\reader.py", line 92, in download
fp = self.options.transport.open(Request(url))
File "C:\Python34\lib\site-packages\suds\transport\https.py", line 62, in open
return HttpTransport.open(self, request)
File "C:\Python34\lib\site-packages\suds\transport\http.py", line 69, in open
raise TransportError(str(e), e.code, e.fp)
suds.transport.TransportError: HTTP Error 500: Internal Server Error
我错过了什么吗?
【问题讨论】: