Attached is a proposed implementation for SOAP with
Attachments client support. I have tested this against
a web service implemented using Apache Axis 1.1 both
sending a receiving single attachments.
This required minor changes to the ZSI/client.py to add
hooks to allow processing during sending and receiving
of a web service call. The
attachmentExample_services.py file was modified by hand
to add the attachment hook support. I'm not sure this
can be rolled into the wsdl2py tool since the WSDL does
not contain information whether SOAP with Attachments
are being used.
Implementation and example of client support for SOAP with Attachments
Logged In: YES
user_id=711996
I looked at the patches and modules you provided. I think you should use the
resolver available to ParsedSoap for grabbing attachments. Additional
Support would need to be added to the SoapWriter class in order to reference
attachments from the SOAP message. Seems like you'd need to wrap the
attachement in some "Attachment" wrapper and during serialization, it would
get serialized as an href to the "Content-ID" value.
So since this can only happen in certain contexts the SoapWriter.Known"
method could be modified to include:
SoapWriter
....
def Known(self, pyobj):
if isinstance(pyobj, Attachment):
return pyobj.getID()
.....
Something like that,
Then one could include attachments in serializable objects, destined for the
SOAP:Envelope.