Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transferring large files with web services

What is the best way to transfer large files with web services ? Presently we are using the straight forward option to transfer the binary data by converting the binary data into base 64 format and embeding the base 64 encoding into soap envelop itself.But it slows down the application performance considerably.Please suggest something for performance improvement.

like image 440
Hector Barbossa Avatar asked Mar 07 '11 11:03

Hector Barbossa


People also ask

How can I send large files via HTTP?

Gallery2, which allows you to upload photos over http, makes you set up a couple of php parameters, post_max_size and upload_max_filesize , to allow larger uploads. You might want to look into that.


2 Answers

In my opinion the best way to do this is to not do this!

The Idea of Webservices is not designed to transfer large files. You should really transfer an url to the file and let the receiver of the message pull the file itsself.

IMHO that would be a better way to do this then encoding and sending it.

like image 154
Chris Avatar answered Oct 06 '22 00:10

Chris


Check out MTOM, a W3C standard designed to transfer binary files through SOAP.

From Wikipedia:

MTOM provides a way to send the binary data in its original binary form, avoiding any increase in size due to encoding it in text.

Related resources:

  • SOAP Message Transmission Optimization Mechanism
  • Message Transmission Optimization Mechanism (Wikipedia)
like image 44
Enrico Campidoglio Avatar answered Oct 06 '22 00:10

Enrico Campidoglio