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