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.