WCF dealing with large files, with WS-I interoperability

263 Views Asked by At

There are a number of posts on stackoverflow that deal with WCF and large files but the general recommendation is to use streaming. This doesn't seem like a very interoperable solution.

How do you deal with large files in WCF and still maintain interoperability?

1

There are 1 best solutions below

7
On BEST ANSWER

Honestly the reason why streaming is such a popular solution is that it works well. The normal way that .net handles WS-I style requests is horrifically ineffecient with large files. It's not meant to transmit large files and if you really try to do it then you'll find it hard to scale up to any significant traffic volume.

The best answer is to avoid it. If you need to, add a service request that can "set up" a file transfer over your service, then have a normal HTTP request using a cookie to actually get the file.

If you really must send the file over a WS-I service, all you can do is enable MTOM and hope that you don't get enough requests at once to run the server out of RAM handling those really big XML messages.