Does Python SOAP client library Zeep support attachments?
I could not really find anything in the documentation.
The idea is to send a SOAP request in XML format, with some attached files. I guess the regular way of doing this is a multipart message, which seems to be suppored by requests, upon which Zeep is built.
You can subclass Transport class and override the post_xml method to modify the envelope attach multipart files. I just finihed a silly module (based on this post How to send Multipart/related requests in Python to SOAP server?) that does the trick.
https://github.com/ellethee/python-zeep/blob/master/src/zeep/transport_with_attach.py
hope it can help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With