Tag Archives: MessageContract

ByTrent Jones

WCF and Large File Transfers

I’ve been doing a bit of WCF lately and picked up on a few things that will be helpful for me to remember.  To speed large transfers switch the messageEncoding on the binding to be MTOM, otherwise your data will get base64 encoded inside the XML.

  1. Streaming requires a MessageContract and not a DataContract
  2. Streaming doesn’t work on wsHTTPbinding.
  3. A MessageContract can only have one Member in the body (stream).

Another good piece:
http://www.aspfree.com/c/a/Windows-Scripting/WCF-and-Hosting/3/