This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
Joined: Oct 16, 2006
i am using weblogic 8.1 and dont know whether it supports JAX-WS and MTOM.
pradeep, can you please give sample code or link to upload webservice with soap attachments
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.