How to use multiple message dispatchers on the same channel - enveloped and non enveloped on the same channel

How can I create a server whichs supports non enveloped and enveloped messages next to each other on the same channel?

I am specifying multiple message dispatchers each with a different BinMessage on different URL endpoints

channel.Dispatchers.Add(new MessageDispatcher(“bin”, binMessageNoEnvelope));
channel.Dispatchers.Add(new MessageDispatcher(“binenv”, binMessageWithEnvelope));

The first endpoint works but for the second I get “No message type registered for the requested path: binenv”

How do I solve this?


try to override DefaultDispatcherName like

    public class MyBinMessage : RemObjects.SDK.BinMessage
            public override String DefaultDispatcherName
                            return "binenv";
	var binMessageNoEnvelope = new BinMessage();
	var binMessageWithEnvelope = new MyBinMessage();

	channel.Dispatchers.Add(new MessageDispatcher("bin", binMessageNoEnvelope));
	channel.Dispatchers.Add(new MessageDispatcher("binenv", binMessageWithEnvelope));

This works, thanks.

I still have one question about enveloped messages.
I am using multiple envelopes for the same endpoint. I understand the receiving end can automatically choose the correct implementation. But how do I select the envelope when I am sending the data. Will the response be in the same envelope or will the server (answering side) choose the envelope based on some own rule?


this one.

client can send request with envelope set A
server can answer with envelope set B

Check the Message Envelopes sample (Delphi). it may make clear how this thing works