How to force WCF to always send data stream using MTOM with XOP encoding even the data stream is smaller than 1024 bytes?

Sep 3, 2008 at 11:28 PM
Hi,

In the "WCF Endpoint Support for MTOM" section of  the Microsoft web site (http://msdn.microsoft.com/en-us/library/aa738574.aspx), B4152 defines that WCF will only optimize element information items that contain base64-encoded data and exceed 1024 bytes in length. So, does it mean that WCF will only use MTOM with XOP encoding when the data stream is larger than 1024 bytes? If so, is there a way to force WCF to always send data stream using MTOM with XOP encoding even the data stream is smaller than 1024 bytes?

Regards,
Edwood
Developer
Oct 1, 2008 at 9:56 PM
Hi Edwood,

  WCF endpoint will always using MTOM+XOP. The difference is that in the cases where the data stream is less than 1024 bytes, this data stream will not become an attachment, but will stay in the original body of the message. But the message will still have the MTOM+XOP header.

Cheers, Wagner.