Take the 2-minute tour ×

My customer asked me to implement MTOM/XOP for .NET Remoting via HTTP/SOAP for remote stream access (for example, file uploading). WCF web services in not an option.

So, what I have to do is modify our custom SoapClientFormatterSink and SoapServerFormatterSink to do the job, i.e. SerializeMessage method, which takes IMessage and if one of the message parameter' value of type Stream, XOP infoset's node is inserted into stream and so on.

public class CompatibleSoapClientFormatterSink : IClientFormatterSink


  private void SerializeMessage(IMessage message, out ITransportHeaders headers, out     Stream   stream)



The problem is I don't understand how to put binary stream into SOAP request and implementation of this approach in general.

Can someone give me direction to how can I implement it please?

Any code sample of MTOM/XOP implementation would be much appreciated.

share|improve this question

4 Answers 4

I believe that the Java Equivalent of WCF (Metro) supports XOP/MTOM, and it is open source. You could take that code and port it to .NET Remoting.

share|improve this answer
I'll think about this option. Thank you. –  sh0gged Sep 9 '09 at 14:36

Here is someone who has implemented file transfer with .net remoting:


Source code is available from a link on the page

share|improve this answer
Great article. Thanks for the link. Though i'm using http channel, not tcp channel. That means i have to deal with some soap extensions. –  sh0gged Sep 9 '09 at 14:35

You could try:


If you do have a java server-side you could look at:


there is some code at the bottom of the page for download.

There are some interoperability issues with MTOM between platforms: many stacks don't support the ws-policy mechanism that .NET uses to turn on MTOM. To my mind this is quite undesirable for interoperability. Here we have ended up turning on MTOM messageEncoding in the binding section of the app.config.

share|improve this answer
up vote 0 down vote accepted

Sorry, guys! Nether of your answers work for me.

So I propose my simple idea of the solution which I already had implemented.

I used XmlMtomReader and XmlMtomWriter classes from System.Xml namespace to format SOAP messages and then pass them forward to the formatter sink. WCF web services layer wasn't touched as I wanted.

share|improve this answer

Your Answer


