I’ve a web service SOAP developed with WCF, there is a best practise to versioning it? when I change the contract I don’t want to update all the client’s referiments but I want simply publish a new version that coexists with the old.
STUDY-CASE:
I’ve a web service with one endpoint, all clients point to it,
soon I will have to change the contract and I search a way to avoid that all clients crash.
I know two ways to avoid this:
- publish the web service with the new contract in another server
- create a new file svc with the new contract
there are other ways?
2
It depends on many things such as what changes you are going to make, what platform your clients are built on, what’s your change tracking policy, etc.
For example if you just want to add a new property to a data contract or a new operation to a service contract it’s safe to add it to your current implementation as long as the clients are version tolerant (DataContractSerializer is version tolerant) and it complies with your change tracking policy. However you would better stick to strict versioning strategy which requires creating a new contract and exposing it with a new endpoint in case the changes are more serious.
I suggested reading these articles:
Versioning Strategies
Best Practices: Data Contract Versioning
This should help you to choose the right version strategy and provide your with the best practices to follow.