我正在移植使用suds 0.6
over to开发的代码zeep 2.4.0
。
以前的泡沫代码:
client = Client(WSDLfile, proxy=proxy, faults=True)
config = client.factory.create('perUserDataExportConfiguration')
config.param1 = 'something'
...
data = client.service.exportPerUserData(username,password,config)
zeep代码:
session = requests.Session()
session.verify = False
transport = Transport(session=session)
client = Client(WSDLfile, strict=False, transport=transport)
config = client.type_factory('ns0').perUserDataExportConfiguration()
config.param1 = 'something'
...
data = client.service.exportPerUserData(username,password,config)
然后我得到zeep.exceptions.ValidationError: Missing element param_i_didnt_set
. 看config.__values__
节目
OrderedDict([('param1', 'something'),
('param_i_didnt_set', None), ...])
该suds
config
对象的相似之处在于它包含许多带有空变量的键,但suds
不抛出ValidationErrors
。