How to assign services to server channels?

I would like to create a single executable (a Windows service) to serve different type of clients.

Let’s say I have two services defined in the RODL, ServiceA and ServiceB. Also, I have two channels IpHttpServerChannelA and IpHttpServerChannelB on different ports.

I would like channel A to serve service A and channel B to service B. But, I couldn’t find a way to tell a ServerChannel descendant which ROService(s) it should be serving. Right now, it serves whatever it finds in the RODL.

How can I achieve this (obivously not without ending up with two executables) ?

Thanks, Hakan

Windows 7x64, C#/.NET 4.0, RO SDK 8.1.87.1145

Hello

Yes, this is how it was designed.
Still it is possible to access information about the server channel used to call the service method remotely via the ServerChannel property of the Service.

Unfortunately this property cannot be accessed in the service activation method. Sot there are 2 possibilities - either to test value of the ServerChannel property at the beginning of every service method or to do the following trick:

  1. Add to the service class the IMessageAwareService interface.
  2. This interface will require you to implement a setter for a Message property. In the setter of this property you can access the value of the ServerChannel property and, say, raise an exception if this service shouldn’t be invoked via given server channel.

Regards