Secure and loose coupled communication between clients and WCF services using a RoutingService in between

StackOverflow https://stackoverflow.com/questions/15088422

Question

Is it possible to send objects through RoutingService to peer WCF services without having the router know about the exact type of these objects ?

My intention is to create a router once for all, then be able to add new WCF services, dynamically add them to the routing table, and allow clients to communicate with these services without having to stop, change the code of the router, then start it again.

I was thinking of a generic contract like this:

[DataContract]
public class RequestObject
{
}

[DataContract]
public class ReplyObject
{
}

[ServiceContract]
public interface IGenericServiceInterface
{
    [OperationContract]
    ReplyObject DoJob(string jobType, RequestObject request);
}

I could put this in a common library that all 3 components link to (client, router, services). But, I am not sure, it will be possible to derive new sub classes to allow new clients/services with new data exchanges to be added without having to change the router.

Any advise ? is it possible for the solution to work when encryption is enforced through clients till services ?

Thanks in advance.

Was it helpful?

Solution

There's a good msdn on using the Message class in WCF to build contract agnostic endpoints. Does not use routing service, but you could build a router using this:

http://msdn.microsoft.com/en-us/library/ms734675.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top