<p>我试着</p>
<pre><code>from suds.client import Client
WSDL_URL='http://apitest.comune.genova.it:28280/MANU_WSManutenzioni_MOGE/'
#Create the Client:
print("Print 1")
client = Client(url=WSDL_URL)
print("Print 2")
from suds.sax.element import Element
ssnp = Element("xsi:SessionHeader").append(Element('xsi:Authorization').setText("XXXXXXXXXXX"))
client.set_options(soapheaders=ssnp)
</code></pre>
<p>但是我在下面的行中遇到了一个错误</p>
^{pr2}$
<p>这里的错误是:</p>
<pre><code>Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/suds/transport/http.py", line 67, in open
return self.u2open(u2request)
File "/usr/local/lib/python3.6/site-packages/suds/transport/http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "/usr/lib64/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib64/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib64/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 405: Method Not Allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_ws.py", line 44, in <module>
client = Client(url=WSDL_URL)
File "/usr/local/lib/python3.6/site-packages/suds/client.py", line 115, in __init__
self.wsdl = reader.open(url)
File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 151, in open
d = self.fn(url, self.options)
File "/usr/local/lib/python3.6/site-packages/suds/wsdl.py", line 136, in __init__
d = reader.open(url)
File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 78, in open
d = self.download(url)
File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 94, in download
fp = self.options.transport.open(Request(url))
File "/usr/local/lib/python3.6/site-packages/suds/transport/https.py", line 62, in open
return HttpTransport.open(self, request)
File "/usr/local/lib/python3.6/site-packages/suds/transport/http.py", line 69, in open
raise TransportError(str(e), e.code, e.fp)
suds.transport.TransportError: HTTP Error 405: Method Not Allowed
</code></pre>