简体   繁体   English

使用suds的python webservice客户端中的错误

[英]Error in python webservice client using suds

Im using python 2.7 and suds 0.4 in windows and linux and in both cases I get the same error when calling a method of a web service: 我在Windows和Linux中使用python 2.7和suds 0.4,在两种情况下,调用Web服务的方法时都会遇到相同的错误:

Traceback (most recent call last):
File "wsclient.py", line 23, in <module>
client.service.Echo()
File "build\bdist.win32\egg\suds\client.py", line 542, in __call__
File "build\bdist.win32\egg\suds\client.py", line 602, in invoke
File "build\bdist.win32\egg\suds\client.py", line 643, in send
File "build\bdist.win32\egg\suds\client.py", line 678, in succeeded
File "build\bdist.win32\egg\suds\bindings\binding.py", line 149, in get_reply
AttributeError: 'NoneType' object has no attribute 'promotePrefixes'

My code is really simple: 我的代码非常简单:

import suds.bindings
suds.bindings.binding.envns = ('SOAP-ENV', 'http://www.w3.org/2003/05/soap-envelope')

from suds.client import Client

url = 'http://servicios.publipayments.com/ServicioDW.svc?wsdl'
client = Client(url)
print client
client.service.Echo()

As you can see I already did what the author of suds suggest here and also did the logging in here . 如您所见,我已经做了suds的作者在这里建议的操作并且在这里也进行了登录。 But the result is the same. 但是结果是一样的。

Any ideas will be appreciated. 任何想法将不胜感激。

Regards. 问候。

My understanding about web services was not good enough and the service implementation is using http for exposing the wsdl AND https for the service endpoint. 我对Web服务的理解还不够好,服务实现使用http公开了服务端点的wsdl和https。

So after a helpful hint of the service author I declared the client as: 因此,在服务创建者提供了有用的提示之后,我将客户端声明为:

client = Client('http://someUrl?wsdl', 
                location='https://someUrl/Service.svc')

And that solved the problem. 这就解决了问题。 There was nothing bad with suds. 泡沫没有什么不好的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM