[Soap-Python] Big file transfer with rpclib

Vladimir Rutsky rutsky.vladimir at gmail.com
Wed Apr 18 18:34:40 CEST 2012


Hello!

I need to write several Python web-services for local network that
will exchange with RPC commands with attached files with size 10-1000
MB. I'm trying to use SOAP for message exchanging since XML/JSON RPC
can't handle big messages, and SOAP have few features that allows to
stream files over network (SwA, MTOM).

I see some code related to MTOM in source code of rpclib, is it
possible to transfer big files with current version of rpclib? Is
there any examples of it?

Currently I try to modify binary_soap.py [1] example to return
rpclib.model.binary.File object, but without any luck:

    @srpc(String, _returns=File)
    def get(file_path):
        return [File("test.txt", "/tmp/test.txt")]

SUDS client receives just string:
[File(name='test.txt', path='/tmp/test.txt',
type='application/octet-stream', data=<generator object
to_string_iterable at 0xb6a18644>)]

Thanks in advance,
Vladimir Rutsky

[1] https://github.com/arskom/rpclib/blob/master/examples/binary_soap.py


More information about the Soap mailing list