Type not found wsdl python suds client - suds.Type

2019-02-23 05:01发布

问题:

I want to consume the webservice described in the following:

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

I am using python 2.7.x and suds version 0.4.

What I tried 1

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

Result

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, )'

What I tried 2

After searching in stackoverflow I also tried:

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)])

Result

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, )'

Edit after enabling logging.DEBUG I also get the msg:

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

just before the exception