suds.TypeNotFound:未找到类型:'(,http://www.w3.org/2001/XMLSchema,)'

时间:2014-09-02 08:33:13

标签: python xml web-services soap wsdl

我正在使用网络服务,但以下错误阻止我将其投入使用:

Traceback (most recent call last):
File "C:\Users\Marnik\Documents\GitHub\prjct\CompareSiteCrawler\src\Crawlers\Belboon.py", line 9, in <module>
client = suds.client.Client(url,plugins=[ImportDoctor(imp)])
File "C:\Python27\Lib\site-packages\python-suds-0.4\suds\client.py", line 119, in __init__
sd = ServiceDefinition(self.wsdl, s)
File "C:\Python27\Lib\site-packages\python-suds-0.4\suds\servicedefinition.py", line 57, in __init__
self.addports()
File "C:\Python27\Lib\site-packages\python-suds-0.4\suds\servicedefinition.py", line 85, in    addports
method = (m.name, binding.param_defs(m))
File "C:\Python27\Lib\site-packages\python-suds-0.4\suds\bindings\rpc.py", line 39, in param_defs
return self.bodypart_types(method)
File "C:\Python27\Lib\site-packages\python-suds-0.4\suds\bindings\binding.py", line 441, in   bodypart_types
raise TypeNotFound(query.ref)
suds.TypeNotFound: Type not found: '(, http://www.w3.org/2001/XMLSchema, )'

现在我已经搜索了解决方案,几乎所有找到的解决方案都是以下,或者非常相似:

imp = Import('http://schemas.xmlsoap.org/soap/encoding/', location='http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add('http://ws.client.com/Members.asmx')
client = Client(url,plugins=[ImportDoctor(imp)]

这对我来说不起作用,即使在使用WSDL文件的targetNameSpace替换imp.filter.add之后的部分也是如此。我对WSDL不是很熟悉,但我通过xml文件进行了泄漏,遇到了以下情况:

<definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:SmartFeedServices" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="SmartFeedServices" targetNamespace="urn:SmartFeedServices">
    <types xmlns="http://schemas.xmlsoap.org/wsdl/"/>
    <!--  Messages  -->
    <!--  Input parameters for method login  -->

查看其他WSDL文件我注意到两件事:此特定XML文件中的targetNameSpace不是url,我查看的所有其他WSDL文件都有一个url targetNameSpace

其次,type元素为空。其他WSDL文件在此处具有其他元素,例如targetNameSpace

这两个(或两个)中的一个可能是问题吗?

0 个答案:

没有答案