python-zeep
python-zeep copied to clipboard
issue parsing dict with array
calling the soap services InsertDraftElectronicInvoice

using a dict,
answer = client.service.InsertDraftElectronicInvoice(
paramAuth={"CustomerCode": CODICE_CLIENTE, "Password": BYTES_PASSWORD_CLIENTE_CIFRATA},
uploadRequest={
"UploadingFiles": [{
"UploadElectronicInvoiceFileRequest": {
"TransactionId": "",
"FileName": filename,
"Content": content,
"StateInvoice": "ToSend",
"ProformaInvoice": True,
"PathFileInvoice": ""
},
"UploadElectronicInvoiceFileRequest": {
"TransactionId": "",
"FileName": filename,
"Content": content,
"StateInvoice": "ToSend",
"ProformaInvoice": True,
"PathFileInvoice": ""
}
}]
}
)
the library will send only the first element of the array
but if i use the get_type
answer = client.service.InsertDraftElectronicInvoice(
paramAuth={"CustomerCode": CODICE_CLIENTE, "Password": BYTES_PASSWORD_CLIENTE_CIFRATA},
uploadRequest=client.get_type('ns0:UploadElectronicInvoiceRequest')(
client.get_type('ns0:ArrayOfUploadElectronicInvoiceFileRequest')(
[client.get_type('ns0:UploadElectronicInvoiceFileRequest')(
FileName="uno.xml",
Content=content,
StateInvoice="ToSend",
ProformaInvoice=True
),
client.get_type('ns0:UploadElectronicInvoiceFileRequest')(
FileName="due.xml",
Content=content,
StateInvoice="ToSend",
ProformaInvoice=True
)
]
)
)
)
it works, sending array with two elements.
I too am experiencing this bug.
+1