Python SOAP客户端无法与此WSDL配合使用

2 投票
1 回答
1788 浏览
提问于 2025-04-15 13:56

到目前为止,我尝试访问这个WSDL:

https://login.azoogleads.com/affiliate/tool/soap_api

我用的是两个常见的Python SOAP客户端:SOAPpy和ZSI.client.Binding。使用SOAPpy时,它在PyXML中抛出了一个异常(xml.parsers.expat.ExpatError: not well-formed (invalid token)),而ZSI则在urlparse库中抛出了一个异常。

我希望的是:

1.) 我可能是错误地使用了这些库(下面有我的用法)

或者

2.) 可能还有其他我不知道的SOAP库可以处理这个问题

以下是我使用这些库的代码:

from ZSI.client import Binding
b = Binding('https://login.azoogleads.com/affiliate/tool/soap_api/')
hash = b.authenticate('should', 'get', 'authenticationfailurefromthis')

还有

import SOAPpy
b = SOAPpy.WSDL.Proxy('https://login.azoogleads.com/affiliate/tool/soap_api/')
hash = b.authenticate('any', 'info', 'shoulddo')

1 个回答

2

你实际上没有给出一个有效的WSDL地址,试着明确地提供WSDL文件的位置,而不是它所在的文件夹。记住,计算机是非常笨的东西!

撰写回答