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

 博艺 发布于 2022-12-23 07:19

我想使用以下描述的Web服务:

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

我使用python 2.7.x和肥皂水 版本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 "", line 1, in 
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 "", line 1, in 
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 

就在例外之前

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有