suds调用没定义schema的webservice

有些wsdl没有定义schema,别的语言的库可能会自动修补这个问题,但是suds不会。当你的程序出现类似如下错误时,极有可能就是碰上了这种wsdl:


    Type not found: '(string, http://schemas.xmlsoap.org/soap/encoding/, )

解决方案:


   from suds.xsd.doctor import ImportDoctor, Import
   from suds.client import Client

   imp = Import('http://schemas.xmlsoap.org/soap/encoding/')
   doc = ImportDoctor(imp)
   url = '你的wsdl url地址放在这里'
   c = Client(url, doctor=doc)

For example, "name@something.com". If someone replies to you it will be via email.
For example, "http://someaddress.com"