[Soap-Python] Big file transfer with rpclib

Vladimir Rutsky rutsky.vladimir at gmail.com
Thu Apr 19 14:55:58 CEST 2012


On 04/19/2012 12:47 AM, Burak Arslan wrote:
> Hi Vladimir,
>
> Rpclib's mtom implementation is 90% there. But because there are no 
> test cases for it, it's not currently working, nor is it properly 
> documented. For instance, you need to explicitly enable mtom passing 
> the _mtom=True flag to the @rpc decorator.
>
> rpclib.model.binary.File was not tested with soap, so I guess it 
> requires a custom soap serializer routine to work properly.
>
> Those said, I don't think suds supports mtom either. Did you check the 
> suds side of things?
As soon as I know SUDS does not support MTOM, I tried to use it as 
simple SOAP client to test if server will stream any content.

>
> Why not just use http?
I need RPC to remotely call some functions and return results with note 
that some arguments or results can be big files, so I want to use some 
ready RPC solution that can also transfer files.

If I use plain HTTP in a REST-like way I need to manually implement RPC 
functionality, like parse GET query arguments and translate them into my 
function call, wrap files for upload in POST request and so on. In both 
solutions (SOAP or REST-like HTTP) actual data will be transferred over 
HTTP.

Also potentially my services will communicate with other Java-based 
services and it would be awesome if they will be able to interoperate 
over single and standardised protocol, like SOAP (which is quite well 
works in Java, as I heard).

So if file transfer in Rpclib is not ready yet (and there is no other 
Python libraries that can do MTOM as far as I know), I will go with 
transfer in plain HTTP solution.


Thanks for respond,

Vladimir Rutsky

>
> Best,
> Burak
>
>
> On 04/18/12 19:34, Vladimir Rutsky wrote:
>> 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
>> _______________________________________________
>> Soap mailing list
>> Soap at python.org <mailto:Soap at python.org>
>> http://mail.python.org/mailman/listinfo/soap
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/soap/attachments/20120419/37962abf/attachment.html>


More information about the Soap mailing list