SOAP suds and the dreaded schema Type Not Found error

前端 未结 3 1390
心在旅途
心在旅途 2020-11-30 08:53

I\'m using the latest version of suds (https://fedorahosted.org/suds/) for the first time and I\'m getting stalled at step one.

suds.TypeNotFound: Type not          


        
3条回答
  •  误落风尘
    2020-11-30 09:45

    For those who still is troubled by this problem. This link https://bitbucket.org/jurko/suds/issue/20/typenotfound-schema may provide useful information. The solution would be like this:

    from suds.client import Client
    from suds.xsd.doctor import Import, ImportDoctor
    
    url = 'http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl'
    imp = Import('http://www.w3.org/2001/XMLSchema',
        location='http://www.w3.org/2001/XMLSchema.xsd')
    imp.filter.add('http://WebXml.com.cn/')
    client = Client(url, doctor=ImportDoctor(imp))
    

提交回复
热议问题