找不到类型wsdl python suds client - suds.TypeNotFound

时间:2014-09-08 09:26:25

标签: python web-services soap wsdl suds

我想使用以下所述的网络服务:

http://www.content.de/api/clientservices.php?wsdl

我正在使用python 2.7.x和 suds 版本0.4

我尝试了什么1

from suds.client import Client
url = 'http://www.content.de/api/clientservices.php?wsdl'
client = Client(url) 

结果

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/client.py", line 119, in __init__
sd = ServiceDefinition(self.wsdl, s)
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/servicedefinition.py", line 57, in __init__
self.addports()
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/servicedefinition.py", line 85, in addports
method = (m.name, binding.param_defs(m))
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/bindings/rpc.py", line 39, in param_defs          
return self.bodypart_types(method)
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/bindings/binding.py", line 441, in bodypart_types 
raise TypeNotFound(query.ref)
suds.TypeNotFound: Type not found: '(, http://www.w3.org/2001/XMLSchema, )'

我尝试了什么2

在stackoverflow中搜索后,我也试过了:

from suds.xsd.doctor import ImportDoctor, Import
from suds.client import Client
url = 'http://www.content.de/api/clientservices.php?wsdl'
imp = Import('http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add('urn:ClientServices')
client = Client(url, plugins=[ImportDoctor(imp)])

结果

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/client.py", line 119, in __init__
sd = ServiceDefinition(self.wsdl, s)
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/servicedefinition.py", line 57, in __init__
self.addports()
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/servicedefinition.py", line 85, in addports
method = (m.name, binding.param_defs(m))
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/bindings/rpc.py", line 39, in param_defs
return self.bodypart_types(method)
File "/home/xubuntu/.virtualenvs/adwiz/local/lib/python2.7/site-packages/suds/bindings/binding.py", line 441, in bodypart_types
raise TypeNotFound(query.ref)
suds.TypeNotFound: Type not found: '(, http://www.w3.org/2001/XMLSchema, )'

启用logging.DEBUG后编辑我也得到了msg:

DEBUG:suds.xsd.query:(u'', u'http://www.w3.org/2001/XMLSchema'), not-found 

在异常之前

0 个答案:

没有答案