what is the best way to send a large files of size around 200 mb from client to a webservice. sending files from client through webservice to server. i had written a webservice for this but it gives out of memory exception for files of size around 15mb. is soap attachments a good solution for this? can anyone please provide some sample code for this implementation
Best possible way is to avoid using web service to do this, but in case that you have no other choice you can use SOAP attachment. If you are using GlassFish (METRO stack) or other implementation which support MTOM you may use MTOM optimizations which can be used to transfer big files.
What is your ram size and the JVM s of 2 GB max. Please check the ram sizes. I am able to upload the 1 G.B file using Apache Axis + SOAP Attachment + 3 GB RAM. And possible check the configurations of the web logic attachment size limit.
Given the vintage of the implementation I have my doubts that a 200 MB attachment would be handled properly (I'd expect to see a 10 MB limit) - but you would have to test that.
Large file transfers should really be handled by protocols more suited to the task - like FTP. The web service provider would then handle the creation of temporary FTP identities/privileges/credentials and return the necessary information to the web service consumer.