Ruslan
Ruslan

Reputation: 10147

Generic WCF Routing/Forwarding/Proxy Server

Is it possible to create a "generic" as in "adaptable" routing service, which will NOT have any public methods to call. Instead, you'd be able to call any command, which would then be mapped in the service and will pass it to appropriate end point with simple message transformation where required. It may be hard to understand and idea might seem a bit crazy (it came from a colleague of mine), but it's clearer if you look at the example:

WCF 4.0 Routing Service –Content Based Routing (CBR).

similar to what's described in this article, only difference is that our service should not have a "SubmitTimeSheet" public method, in fact it should have no public methods to call. We'd have to "intercept" an incoming call on a much lower level before it returns "Method Not Found" error.

Is this at all possible? The reason for this is obvious: possibility of adding new clients without having to change the code. All we'd have to do is to add a new mapping entry in some sort of config file or even database, e.g.

<Client address="newClientAddress" method="DoAnything" transformation="NewClientDoAnything.xslt" endPoint="endPointClientAddress" endPointMethod="endPointClientDoAnything" />

Upvotes: 2

Views: 1505

Answers (2)

Daniel de Zwaan
Daniel de Zwaan

Reputation: 3105

Check out WCF 4 routing - supports content based routing, xpath transforms and much more.

http://blogs.msdn.com/b/routingrules/

Upvotes: 2

Aliostad
Aliostad

Reputation: 81660

They have already done it in Nirvana. But it is very expensive.

This is not possible in WCF unless you define your contract as a very loose, fit-for-all contract which takes a message and returns a message. By doing this, you will los all the goodness (although not huge goodness in WCF) of WCF.

Upvotes: 0

Related Questions