python创建字符串数组_用zeep创建一个字符串数组参数?

我有一个供应商提供的webservice;某个操作的WSDL如下所示:

...

...

在WSDL上运行python -mzeep ipam_export.wsdl会产生以下结果:

^{pr2}$

我在执行initExportDevice调用时遇到困难,特别是options参数。在filter_type=client.get_type('ns1:string')

filter=filter_type('addrType=4')

options_type=client.get_type('ns0:ArrayOf_soapenc_string')

options=options_type(['recurseContainerHierarchy'])

client.service.initExportDevice(filter, options)

但这引发了一个例外Any element received object of type 'str', expected lxml.etree._Element or zeep.objects.string

See http://docs.python-zeep.org/en/master/datastructures.html#any-objects for more information

任何options_type=client.get_type('ns0:ArrayOf_soapenc_string')

options=options_type('recurseContainerHierarchy')

client.service.initExportDevice(filter, options)

或者factory = client.type_factory('ns0')

options=factory.ArrayOf_soapenc_string(['recurseContainerHierarchy'])

client.service.initExportDevice(filter=filter, options=options)

或者factory = client.type_factory('ns0')

options=factory.ArrayOf_soapenc_string('recurseContainerHierarchy')

client.service.initExportDevice(filter=filter, options=options)

或者factory = client.type_factory('ns0')

options=factory.ArrayOf_soapenc_string(_value_1=['recurseContainerHierarchy'])

client.service.initExportDevice(filter=filter, options=options)

所有人都提出了同样的例外options_type=client.get_type('ns0:ArrayOf_soapenc_string')

options=xsd.AnyObject(options_type, ['recurseContainerHierarchy'])

client.service.initExportDevice(filter, options)

收益率argument of type 'AnyObject' is not iterable

如何构造这个参数?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值