0
我有一個運行在Windows 7盒子上的ASP.NET webservice。我有兩個Linux框(Ubuntu 12.04),我試圖使用Python 2.7.3和Suds 0.4來訪問web服務。我試圖執行腳本如下:Python suds錯誤「NoneType」對象沒有屬性'promotePrefixes'「
from suds import client
from suds.transport.https import WindowsHttpAuthenticated
url = "https://webserver.mydomain.com/webservice/services.asmx?WSDL"
ntlm = WindowsHttpAuthenticated(username = "user", password = "pwd")
c = client.Client(url, transport = ntlm)
resp = c.service.GetData()
在我的Linux機器之一,該代碼執行完美,resp
將包含從Web服務返回預期的數據。而Linux中,我得到了以下錯誤消息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/www/dev/local/lib/python2.7/site-packages/suds/client.py", line 542, in __call__
return client.invoke(args, kwargs)
File "/var/www/dev/local/lib/python2.7/site-packages/suds/client.py", line 602, in invoke
result = self.send(soapenv)
File "/var/www/dev/local/lib/python2.7/site-packages/suds/client.py", line 643, in send
result = self.succeeded(binding, reply.message)
File "/var/www/dev/local/lib/python2.7/site-packages/suds/client.py", line 678, in succeeded
reply, result = binding.get_reply(self.method, reply)
File "/var/www/dev/local/lib/python2.7/site-packages/suds/bindings/binding.py", line 149, in get_reply
soapenv.promotePrefixes()
AttributeError: 'NoneType' object has no attribute 'promotePrefixes'
我需要什麼設置的一些想法,等可能會導致在兩臺機器之間的這種行爲差異。提前致謝!
嘗試suds-jurko,看看錯誤是否仍然存在:http://pypi.python.org/pypi/suds-jurko – 2014-10-20 19:44:41
@SimeonVisser - 試過泡沫-0.4,並得到了同樣的錯誤。我也在Windows 7上試過,並且也出現了相同的錯誤。但是,感謝這個想法。 – 2014-10-20 21:38:49
此頁面幫助:https://bitbucket.org/jurko/suds/issue/50/error-unmarshalling-reply-promoteprefixes?它可能是一個格式錯誤的WSDL文件。 – 2014-10-20 22:55:17