WCF Routing and use of single connection

207 views Asked by At

I am playing with WCF Routing. It works fine from the start ... but there is an issue I couldn't pass. In my playground I have routing service and 4 other WCF services implementing 2 different contracts. As I said it works fine ... but when accessing both contracts from client side, from single thread, I have to make 2 different connections. To access contracts ChannelFactory<> is used. I tried to get through WCF channel stack to get idea how to implement own binding/channel but failed to achieve the goal of single connection.

There is an option to generate interface as a sum of both interfaces, but this solution is supposed to work in the environment of many (30-40) independent contracts. What complicates and prevents me from applying this simple solution is the fact, that according to the "loose coupling" rule all those 30-40 independent contracts live independently.

Is there a way to construct channel stack in the way that allows us to route many contracts through single WCF Routing service and use single connection (connection pool/connection pool per thread) for accessing them from the client side. ?

Kind regards

Leszek

1

There are 1 answers

4
Richard Blewett On

There is no "toolkit" way of doing this but you could combine the two contract on the client making sure that the actions are preserved and then route by action in the routing service to the correct downstream service