We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough.
We want, however, expose some of the services to some business partners. The set of services they have access to depend on the contract. Kind of a standard architecture.
I think we can implement a service gateway which authenticates the requests and relays them to the correct internal service endpoint (this resembles simple ESB), so we can centralize the authentication/authorization code and expose one single endpoint to the world. I looked at some available ESB toolkits, but they seem way too complex for this purpose. We do not need to integrate a lot of different services, but just to expose some of them to the Internet.
How can I design and implement such a relay/router in WCF, keeping it very simple? I have read Inside Windows Communication Foundation, which is a good book, but I'm still not confident enough on how to begin.
I have done something very similar to this. What you can do is expose an endpoint with a single operation.
That operation would look something like
[OperationContract(Namespace="www.fu.com", Action="*")]
void CallThis(Message msg);
Have your clients use a proxy that is intended for the service they intended to calling the operation they want. Then have them change the configuration to point to your endpoint/service. The "CallThis" method will accept any operation, regardless of its signature. The Message parameter is the WCF Message.
Do what you need to do to determine where things are supposed to go, but you will need to change the "To" to go to your internal endpoint.
I actually have a full implementation of this, so if you have questions, let me know.
Joe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With