WCF streaming inside data contracts

(A small break from the current WCF extensibility series, as I faced this issue helping a customer this week and I thought it would be worth sharing) In order to support transferring of large messages (e.g., uploading or downloading a large file), WCF added support (since its first version) to streaming message transfer – unlike…

9

Using MTOM in a WCF custom encoder

One of the out-of-the-box XML encoders for messages in WCF is the MTOM encoder. It provides an efficient way of transmitting large binary data in the body of SOAP envelopes (by *not* applying the base-64 encoding to such data, which increases its size by roughly 33%), while still being interoperable with other platforms (MTOM is…

4

WCF Binary XML and dictionaries

One of the encodings which come with WCF (since its first version, in .NET Framework 3.0) is a fast and lightweight encoding for XML documents. The WCF Binary XML format (“officially” called .NET Binary Format: XML Data Structure – http://msdn.microsoft.com/en-us/library/cc219210(v=PROT.10).aspx). It is essentially a new way of representing XML, without using the “normal” angle-bracket notation…

1

Changing prefixes in XML responses for WCF services

When responding to requests using any of the text/XML bindings (BasicHttpBinding / WSHttpBinding / CustomBinding with a TextMessageEncodingBindingElement), WCF has some specific prefixes which it uses corresponding to a certain namespaces. The SOAP namespace (“http://www.w3.org/2003/05/soap-envelope” for SOAP 1.2, “http://schemas.xmlsoap.org/soap/envelope/” for SOAP 1.1), for example, is always mapped to the prefix “s”. This is usually not…

7