Eduardo Ghidini
Eduardo Ghidini

Reputation: 249

Asmx Web Service to Download Large File

I have a problem when downloading a large file (around 400mb) with a web service. Today we have an asmx web service (using soap protocol) to get this file (returning a byte []) and a windows service using a reference of this web service to download the files. If the file has a large size, it consumes a lot of RAM MEMORY (almost all of the available computer memory). I wanna know what is a better way to download a file by windows service, without consuming a lot of ram memory.

Upvotes: 4

Views: 2412

Answers (2)

Filip
Filip

Reputation: 2347

Depending on what your files are, you may get very good results with built-in compression to reduce the file size and, subsequently, your issue. Check the EnableDecompression property of the SoapHttpClientProtocol class, which you can subclass on your client and use the compression functionality offered by IIS. This approach could eliminate the need for any other modification. A few hundred megabytes should not be such a big deal, or does your app consume more?

Edit: Upon reading your question more carefully, it occurs to me that you are looking for a different way to dl your files altogether. In that case, it would probably be the simplest approach to just expose the file via http/ftp and make your windows service download it with the WebClient class

Upvotes: 1

Asif Mushtaq
Asif Mushtaq

Reputation: 13150

You can use MTOM for large file transformation.

Upvotes: 0

Related Questions