Large Message Transfers

Transferring large amounts of data between clients and services requires forethought. When messages are text encoded, large binary payloads introduce certain inefficiencies. Binary data is Base64 encoded, which adds overhead to message processing for encoding and decoding efforts. In addition, encoding binary data bloats the size of the data by an added 33 percent (or so), thus impacting the transfer rate. Beyond encoding and transfer rate, there are other considerations relevant to large binary transfers including the need to reduce the overhead of memory usage at the client and service.


Base64 is a type of transfer encoding that converts binary data to a textual (ASCII) representation used for MIME encoding email attachments or embedding binary data in an XML document.

Dealing with these distinct issues requires consideration for binding configurations, and, in some cases, service design. With WCF, you can reduce the overhead of binary encoding and payload bloat with binary or MTOM message encoding. To reduce the memory footprint of large transfers, you can turn to streaming transfer modes for binary data. In this section, you’ll complete two labs to work with MTOM and streaming. Following the labs, I’ll explain these concepts.

Lab: Using MTOM to Handle Large Messages with Binary Data

In this lab, you will upload photos over HTTP using optimized MTOM encoding. You’ll modify an existing solution, changing the binding configuration of both client and service ...

Get Learning WCF now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.