2

I'm looking for a way to version services.

So far we've establish lax versionning principle. For minor versions, we maintain backward compatibility. For breaking change we force a new major version.

For major version, we do not mind changing the name of the service (we could have change the namespace, but we settled for the name).

For minor version, we do not want to change the name nor namespace since that would break clients relying on older minor versions.

My question is: how could we discover how to implement version discovery then? There doesn't seem to be a place in WSDL to put 'information' that wouldn't break the contract. What I want is a way to do is to tell, for a given environment (say staging vs production), what is the service version currently deployed.

WSDL seemed natural for that since it's accessible with an HTTP-GET (REST) and it doesn't require to introduce non-business SOAP service operation (e.g. int GetCurrentVersion() ).

Any ideas?

2 Answers2

0

WSDL does have a capability to contain "wsdl:document" tags for adding documentation but for programmatic access you'd probably want to a custom soap headers. This blog post shows how you could use the custom headers. The WCF Extras code has some neat behaviors to do both custom soap headers and wsdl document tags. @marc_s answer to this question is another approach.

Community
  • 1
  • 1
Sixto Saez
  • 12,610
  • 5
  • 43
  • 51
0

WSDL directly doesn't have any such feature but you can create custom behavior and for example add wsdl:documentation describing the version of your contract. The description of adding custom behavior affecting WSDL is in my other answer. The full example of manipulating wsdl:documentation is on MSDN.

Community
  • 1
  • 1
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670