我将 SOAPpy 用于肥皂 wsdl 服务。我正在关注这个toturail。我的代码如下
from SOAPpy import WSDL
wsdlfile = 'http://track.tcs.com.pk/trackingaccount/track.asmx?WSDL'
server = WSDL.Proxy(wsdlfile)
我在代码的最后一行收到此错误
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/SOAPpy/WSDL.py", line 85, in __init__
self.wsdl = reader.loadFromString(str(wsdlsource))
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/wstools/WSDLTools.py", line 52, in loadFromString
return self.loadFromStream(StringIO(data))
TypeError: initial_value must be unicode or None, not str
我尝试使用将字符串转换为 utf
wsdlFile = unicode('http://track.tcs.com.pk/trackingaccount/track.asmx?WSDL, "utf-8")
但仍然有同样的错误。这里缺少什么?