Building a routing service
There is one interesting scenario in WCF service development, which is to build an intermediate routing service between the client consumers and the backend real service. This is quite useful for many cases, for example, the backend service machine might not be directly accessible from client consumers or the service provider might want to add additional routing logic so as to differentiate the service requests from various client consumers.
Though building routing service is supported ever since WCF in .NET Framework 3.x, the new routing service feature in WCF 4.0 makes it rather easy to create our own WCF routing service.
This recipe will demonstrate how to create a WCF 4.0 routing service that routes service operation requests based on the request message content.
How to do it...
The sample routing service here will help route the service operation requests received from client consumers to the target real service at backend server. Here are the detailed steps...