wcfapiversioningwcf-routing

Versioning WCF service with a routing service


I have been tasked with working out a versioning strategy for a new suite of WCF services. Much of the reading I have done recommends the use of an intermediate routing service to forward on calls to the appropriate service version. I understand how this works but am questioning how much benefit this gives in terms of shielding clients from breaking changes.

For example, I have two versions of a service with different endpoints:

mycompany.com/API/v1.0/GetCustomer
mycompany.com/API/v2.0/GetCustomer

A routing service solution would look for a custom 'version' header in the SOAP message and route the call to the appropriate service. If no version header is found then the latest version could be used.

Alternatively, I could just expose both endpoints and the consumer can call the required version.

How is one solution better than the other? Adding the routing service seems to add an extra level of configuration. Both solutions require the consumer to change their code if they wish to upgrade...

It may be better to ask this in a separate post but maintaining multiple versions of a service means we will need concurrent versions of contracts in our source code. Is there any recommended way of managing this (e.g. namespacing)?

Thanks


Solution

  • You can use routing in combination with WCF Action filtering. You can look at http://www.dotnetcurry.com/ShowArticle.aspx?ID=470