Tuesday, September 14, 2010

WCF - Streaming Large Data

I've been re-developing our web service for sending transmitting files to better handle large files. It was using an ASP.NET ASMX web service to send a byte[] and now it is using the WCF Streamed transferMode to send a MessageContract containing a Stream via MTOM! Sounds very grand doesn't it...

Found the following MSDN resources very helpful:

Hosting and Consuming WCF Services
System.ServiceModel Namespace

Large Data and Streaming
Streaming Message Transfer
How to: Enable Streaming
MTOM Encoding
Using Data Contracts
Using Message Contracts

P.S. An annoyance whilst trying to work out why the Streamed transferMode was not working was that the Visual Studio 2010 in-built web server could not handle it. As soon as it was deployed to IIS it worked fine!

No comments: