mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.87k stars 579 forks source link

How to build valid data structure(ArrayOfArrays) #1323

Closed xzrokeman closed 1 year ago

xzrokeman commented 1 year ago

here's the wsdl:

<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" xmlns:intf="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:client.wsvoucher" xmlns:tns2="http://app.gl.fi.eas.kingdee.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher">
<!-- WSDL created by Apache Axis version: 1.4.1-SNAPSHOT
Built on Jun 15, 2017 (10:55:06 UTC) -->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:client.wsvoucher">
<import namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher"/>
<import namespace="http://app.gl.fi.eas.kingdee.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="WSInvokeException">
<sequence/>
</complexType>
<complexType name="WSBean">
<sequence/>
</complexType>
<complexType name="WSWSVoucher">
<complexContent>
<extension base="tns1:WSBean">
<sequence>
<element name="accountNumber" nillable="true" type="xsd:string"/>
<element name="assistAbstract" nillable="true" type="xsd:string"/>
<element name="assistBizDate" nillable="true" type="xsd:string"/>
<element name="assistEndDate" nillable="true" type="xsd:string"/>
<element name="asstActName1" nillable="true" type="xsd:string"/>
<element name="asstActName2" nillable="true" type="xsd:string"/>
<element name="asstActName3" nillable="true" type="xsd:string"/>
<element name="asstActName4" nillable="true" type="xsd:string"/>
<element name="asstActName5" nillable="true" type="xsd:string"/>
<element name="asstActName6" nillable="true" type="xsd:string"/>
<element name="asstActName7" nillable="true" type="xsd:string"/>
<element name="asstActName8" nillable="true" type="xsd:string"/>
<element name="asstActNumber1" nillable="true" type="xsd:string"/>
<element name="asstActNumber2" nillable="true" type="xsd:string"/>
<element name="asstActNumber3" nillable="true" type="xsd:string"/>
<element name="asstActNumber4" nillable="true" type="xsd:string"/>
<element name="asstActNumber5" nillable="true" type="xsd:string"/>
<element name="asstActNumber6" nillable="true" type="xsd:string"/>
<element name="asstActNumber7" nillable="true" type="xsd:string"/>
<element name="asstActNumber8" nillable="true" type="xsd:string"/>
<element name="asstActType1" nillable="true" type="xsd:string"/>
<element name="asstActType2" nillable="true" type="xsd:string"/>
<element name="asstActType3" nillable="true" type="xsd:string"/>
<element name="asstActType4" nillable="true" type="xsd:string"/>
<element name="asstActType5" nillable="true" type="xsd:string"/>
<element name="asstActType6" nillable="true" type="xsd:string"/>
<element name="asstActType7" nillable="true" type="xsd:string"/>
<element name="asstActType8" nillable="true" type="xsd:string"/>
<element name="asstSeq" type="xsd:int"/>
<element name="attaches" type="xsd:int"/>
<element name="auditor" nillable="true" type="xsd:string"/>
<element name="bizDate" nillable="true" type="xsd:string"/>
<element name="bizNumber" nillable="true" type="xsd:string"/>
<element name="bookedDate" nillable="true" type="xsd:string"/>
<element name="cashAsstActName1" nillable="true" type="xsd:string"/>
<element name="cashAsstActName2" nillable="true" type="xsd:string"/>
<element name="cashAsstActName3" nillable="true" type="xsd:string"/>
<element name="cashAsstActName4" nillable="true" type="xsd:string"/>
<element name="cashAsstActName5" nillable="true" type="xsd:string"/>
<element name="cashAsstActName6" nillable="true" type="xsd:string"/>
<element name="cashAsstActName7" nillable="true" type="xsd:string"/>
<element name="cashAsstActName8" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber1" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber2" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber3" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber4" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber5" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber6" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber7" nillable="true" type="xsd:string"/>
<element name="cashAsstActNumber8" nillable="true" type="xsd:string"/>
<element name="cashAsstActType1" nillable="true" type="xsd:string"/>
<element name="cashAsstActType2" nillable="true" type="xsd:string"/>
<element name="cashAsstActType3" nillable="true" type="xsd:string"/>
<element name="cashAsstActType4" nillable="true" type="xsd:string"/>
<element name="cashAsstActType5" nillable="true" type="xsd:string"/>
<element name="cashAsstActType6" nillable="true" type="xsd:string"/>
<element name="cashAsstActType7" nillable="true" type="xsd:string"/>
<element name="cashAsstActType8" nillable="true" type="xsd:string"/>
<element name="cashflowAmountLocal" type="xsd:double"/>
<element name="cashflowAmountOriginal" type="xsd:double"/>
<element name="cashflowAmountRpt" type="xsd:double"/>
<element name="companyNumber" nillable="true" type="xsd:string"/>
<element name="creator" nillable="true" type="xsd:string"/>
<element name="creditAmount" type="xsd:double"/>
<element name="currencyNumber" nillable="true" type="xsd:string"/>
<element name="cussent" type="xsd:int"/>
<element name="customerNumber" nillable="true" type="xsd:string"/>
<element name="debitAmount" type="xsd:double"/>
<element name="description" nillable="true" type="xsd:string"/>
<element name="entryDC" type="xsd:int"/>
<element name="entrySeq" type="xsd:int"/>
<element name="icketNumber" nillable="true" type="xsd:string"/>
<element name="importKey" nillable="true" type="xsd:string"/>
<element name="invoiceNumber" nillable="true" type="xsd:string"/>
<element name="isCheck" type="xsd:boolean"/>
<element name="itemFlag" type="xsd:int"/>
<element name="localRate" type="xsd:double"/>
<element name="measurement" nillable="true" type="xsd:string"/>
<element name="oppAccountSeq" type="xsd:int"/>
<element name="originalAmount" type="xsd:double"/>
<element name="periodNumber" type="xsd:int"/>
<element name="periodYear" type="xsd:int"/>
<element name="poster" nillable="true" type="xsd:string"/>
<element name="price" type="xsd:double"/>
<element name="primaryCoef" type="xsd:double"/>
<element name="primaryItem" nillable="true" type="xsd:string"/>
<element name="profitCenterNumber" nillable="true" type="xsd:string"/>
<element name="qty" type="xsd:double"/>
<element name="settlementNumber" nillable="true" type="xsd:string"/>
<element name="settlementType" nillable="true" type="xsd:string"/>
<element name="supplyCoef" type="xsd:double"/>
<element name="supplyItem" nillable="true" type="xsd:string"/>
<element name="tempNumber" nillable="true" type="xsd:string"/>
<element name="type" nillable="true" type="xsd:string"/>
<element name="voucherAbstract" nillable="true" type="xsd:string"/>
<element name="voucherNumber" nillable="true" type="xsd:string"/>
<element name="voucherType" nillable="true" type="xsd:string"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher">
<import namespace="urn:client.wsvoucher"/>
<import namespace="http://app.gl.fi.eas.kingdee.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOf_tns1_WSWSVoucher">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:WSWSVoucher[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[][]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOf_tns2_WSWSRtnInfo">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:WSWSRtnInfo[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://app.gl.fi.eas.kingdee.com">
<import namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher"/>
<import namespace="urn:client.wsvoucher"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="WSWSRtnInfo">
<complexContent>
<extension base="tns1:WSBean">
<sequence>
<element name="description" nillable="true" type="xsd:string"/>
<element name="easNumber" nillable="true" type="xsd:string"/>
<element name="exception" nillable="true" type="xsd:string"/>
<element name="message" nillable="true" type="xsd:string"/>
<element name="number" nillable="true" type="xsd:string"/>
<element name="period" type="xsd:int"/>
<element name="voucherType" nillable="true" type="xsd:string"/>
<element name="year" type="xsd:int"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="importVoucherResponse1">
<wsdl:part name="importVoucherReturn" type="impl:ArrayOf_tns2_WSWSRtnInfo"> </wsdl:part>
</wsdl:message>
<wsdl:message name="importVoucherOfReturnIDRequest">
<wsdl:part name="voucherCols" type="impl:ArrayOf_tns1_WSWSVoucher"> </wsdl:part>
<wsdl:part name="isVerify" type="xsd:int"> </wsdl:part>
<wsdl:part name="isImpCashflow" type="xsd:int"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nOperateVoucherResponse">
<wsdl:part name="nOperateVoucherReturn" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="importVoucherRequest">
<wsdl:part name="voucherCols" type="impl:ArrayOf_tns1_WSWSVoucher"> </wsdl:part>
<wsdl:part name="isVerify" type="xsd:int"> </wsdl:part>
<wsdl:part name="isImpCashflow" type="xsd:int"> </wsdl:part>
</wsdl:message>
<wsdl:message name="WSInvokeException">
<wsdl:part name="fault" type="tns1:WSInvokeException"> </wsdl:part>
</wsdl:message>
<wsdl:message name="importVoucherResponse">
<wsdl:part name="importVoucherReturn" type="impl:ArrayOfArrayOf_xsd_string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nImportVoucherResponse">
<wsdl:part name="nImportVoucherReturn" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nExportVoucherResponse">
<wsdl:part name="nExportVoucherReturn" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="importVoucherOfReturnIDResponse">
<wsdl:part name="importVoucherOfReturnIDReturn" type="impl:ArrayOfArrayOf_xsd_string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nOperateVoucherRequest">
<wsdl:part name="params" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nGetBalanceRequest">
<wsdl:part name="params" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nImportVoucherRequest">
<wsdl:part name="rows" type="xsd:string"> </wsdl:part>
<wsdl:part name="params" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nExportVoucherRequest">
<wsdl:part name="params" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="nGetBalanceResponse">
<wsdl:part name="nGetBalanceReturn" type="xsd:string"> </wsdl:part>
</wsdl:message>
<wsdl:message name="importVoucherRequest1">
<wsdl:part name="voucherCols" type="impl:ArrayOf_tns1_WSWSVoucher"> </wsdl:part>
<wsdl:part name="isTempSave" type="xsd:boolean"> </wsdl:part>
<wsdl:part name="isVerify" type="xsd:boolean"> </wsdl:part>
<wsdl:part name="hasCashflow" type="xsd:boolean"> </wsdl:part>
</wsdl:message>
<wsdl:portType name="WSWSVoucherSrvProxy">
<wsdl:operation name="nGetBalance" parameterOrder="params">
<wsdl:input message="impl:nGetBalanceRequest" name="nGetBalanceRequest"> </wsdl:input>
<wsdl:output message="impl:nGetBalanceResponse" name="nGetBalanceResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nExportVoucher" parameterOrder="params">
<wsdl:input message="impl:nExportVoucherRequest" name="nExportVoucherRequest"> </wsdl:input>
<wsdl:output message="impl:nExportVoucherResponse" name="nExportVoucherResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nImportVoucher" parameterOrder="rows params">
<wsdl:input message="impl:nImportVoucherRequest" name="nImportVoucherRequest"> </wsdl:input>
<wsdl:output message="impl:nImportVoucherResponse" name="nImportVoucherResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nOperateVoucher" parameterOrder="params">
<wsdl:input message="impl:nOperateVoucherRequest" name="nOperateVoucherRequest"> </wsdl:input>
<wsdl:output message="impl:nOperateVoucherResponse" name="nOperateVoucherResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucher" parameterOrder="voucherCols isVerify isImpCashflow">
<wsdl:input message="impl:importVoucherRequest" name="importVoucherRequest"> </wsdl:input>
<wsdl:output message="impl:importVoucherResponse" name="importVoucherResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucher" parameterOrder="voucherCols isTempSave isVerify hasCashflow">
<wsdl:input message="impl:importVoucherRequest1" name="importVoucherRequest1"> </wsdl:input>
<wsdl:output message="impl:importVoucherResponse1" name="importVoucherResponse1"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucherOfReturnID" parameterOrder="voucherCols isVerify isImpCashflow">
<wsdl:input message="impl:importVoucherOfReturnIDRequest" name="importVoucherOfReturnIDRequest"> </wsdl:input>
<wsdl:output message="impl:importVoucherOfReturnIDResponse" name="importVoucherOfReturnIDResponse"> </wsdl:output>
<wsdl:fault message="impl:WSInvokeException" name="WSInvokeException"> </wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSWSVoucherSoapBinding" type="impl:WSWSVoucherSrvProxy">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="nGetBalance">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="nGetBalanceRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="nGetBalanceResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nExportVoucher">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="nExportVoucherRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="nExportVoucherResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nImportVoucher">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="nImportVoucherRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="nImportVoucherResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="nOperateVoucher">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="nOperateVoucherRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="nOperateVoucherResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucher">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="importVoucherRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="importVoucherResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucher">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="importVoucherRequest1">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="importVoucherResponse1">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="importVoucherOfReturnID">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="importVoucherOfReturnIDRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.app.gl.fi.eas.kingdee.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="importVoucherOfReturnIDResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:output>
<wsdl:fault name="WSInvokeException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="WSInvokeException" namespace="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSWSVoucherSrvProxyService">
<wsdl:port binding="impl:WSWSVoucherSoapBinding" name="WSWSVoucher">
<wsdlsoap:address location="http://192.168.130.6:6890/ormrpc/services/WSWSVoucher"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

What I am trying to do is call the importVoucher function. For each voucher we have at least 2 voucherCols, each voucherCols have the params describe in WSWSVoucher. I've successfully import 1 line voucher but I'm confused on how to import two lines as a whole.

from zeep import Client
from zeep.transports import Transport
from zeep.xsd import SkipValue, AnyObject

transport = Transport(cache=SqliteCache(r"D:\easWsdlCache\wsdlCache.db"))
client1 = Client(r'http://192.168.130.6:6890/ormrpc/services/WSWSVoucher?wsdl', transport=transport)
WSWSVoucher = client1.get_type('ns0:WSWSVoucher')

line_1 = {
    "companyNumber": "S01", 
    "bookDate": "2022-1-1",
    "bizDate": "2022-1-1", 
    "periodYear": 2022, 
    "periodNumber": 1, 
    "voucherType": "X", 
    "voucherNumber": "S010002",
    "entrySeq": 1, 
    "voucherAbstract": "test", 
    "accountNumber": "6602.006", 
    "currencyNumber": "BB01", 
    "entryDC": 1,
    "originalAmount": 600.00, 
    "debitAmount": 600.00, 
    "creator": "user"
    }

params_ = WSWSVoucher()
for i in params_:
    params_[i] = SkipValue

for k, v in line_1.items():
    params_[k] = v

import_voucher = client1.service.importVoucher(
    params_,
    1,
    0,
    0
    )

The above code worked but I've no idea how to import 2 or more lines as a whole. I tryed:

voucher = AnyObject(WSWSVoucher, value=[params_,params_])
import_voucher = client1.service.importVoucher(
    voucher,
    1,
    0,
    0
    )

and got an error:

TypeError: argument of type 'AnyObject' is not iterable

Any help? @mvantellingen

xzrokeman commented 1 year ago

Well,I find that https://github.com/mvantellingen/python-zeep/issues/558 has answered my question.
first I need to check the namespaces:

client1.namespaces
#----------------------------
{'xsd': 'http://www.w3.org/2001/XMLSchema',
 'ns0': 'urn:client.wsvoucher',
 'ns1': 'http://192.168.130.6:6890/ormrpc/services/WSWSVoucher',
 'ns2': 'http://schemas.xmlsoap.org/soap/encoding/',
 'ns3': 'http://app.gl.fi.eas.kingdee.com'}

then I can get the right type using client.get_type method and add lines as array elements:

emptyplaceholder = client1.get_type('ns1:ArrayOf_tns1_WSWSVoucher')
voucher = emptyplaceholder([])# instantiate using an empty list
voucher.append(params_1)
voucher.append(params_2)
with client1.settings(raw_response=True)
    response = client1.service.importVoucher(voucher, 1, 0, 0)
    assert response.status_code == 200
    assert response.content

Thanks for making this amazing tool~And this issue could be closed~