小编Joh*_*er 的帖子

Python Zeep - 如何使用序列 - >选择

我试图在一个序列中选择使用Zeep,但我无法使这项工作成功.

这是我的代码:

#create trade ref element
tradeReference_element = client.get_element('ns4:tradeReference')
trade_ref_object = xsd.AnyObject(tradeReference_element, tradeReference_element(tradeId="NKY 12/08/17 C21000"))

#create export element
export_element = client.get_element('ns32:export')
export_element_object = xsd.AnyObject(export_element, export_element(_value_1={'tradeReference' : trade_ref_object}))

#use exportEntities service
client.service.exportEntities(export=export_element_object)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

client.service.exportEntities(export=export_element_object)
Traceback (most recent call last):

  File "<ipython-input-14-3cee211bc26a>", line 1, in <module>
    client.service.exportEntities(export=export_element_object)

  File "C:\ProgramData\Anaconda2\lib\site-packages\zeep\client.py", line 41, in __call__
    self._op_name, args, kwargs)

  File "C:\ProgramData\Anaconda2\lib\site-packages\zeep\wsdl\bindings\soap.py", line 110, in send
    options=options)

  File "C:\ProgramData\Anaconda2\lib\site-packages\zeep\wsdl\bindings\soap.py", line 68, in _create
    serialized = operation_obj.create(*args, **kwargs)

  File "C:\ProgramData\Anaconda2\lib\site-packages\zeep\wsdl\definitions.py", line 197, in create
    return self.input.serialize(*args, **kwargs) …
Run Code Online (Sandbox Code Playgroud)

python xsd soap wsdl zeep

5
推荐指数
0
解决办法
870
查看次数

标签 统计

python ×1

soap ×1

wsdl ×1

xsd ×1

zeep ×1