Web Service Contract Versioning
Today we introduce the book “Web Service Contract Design and Versioning for SOA” by Thomas Erl, Anish Karmarkar, Priscilla Walmsley, Hugo Haas, L. Umit Yalcinalp, Canyang Kevin Liu, David Orchard, Andre Tost, James Pasley. More exactly, chapters 20, 21, and 22 of the book addressing the issues related to service contract versioning.
Web services in a SOA-based solution need detailed, technical contracts which clearly specify what each service is meant to do and how is to be used. Since services are subject to change over time, the contract designers need to make sure service consumers use the appropriate variant of the contract, problem solved through versioning.
Chapter 20 - Versioning Fundamentals
In this chapter, the authors present the basic concepts and terminology used in versioning, compatibility issues to be addressed, how to use version identifiers, and several versioning strategies one could choose from.
Since a web service contract can be made up of multiple documents - WSDL definitions, XML Schema definitions, WS-Policy definitions – versioning should apply to all documents that change when the contract changes. Usually, the WSDL versioning is considered, but it is possible changes to appear in XML Schema definitions too, so they also need to be versioned.
There are 4 fundamental types of changes that need to be considered: backward compatible, forward compatible, compatible and incompatible. This section explains each type of change accompanied by examples.
The next sections present the most common versions identifiers used and versioning strategies. Three strategies are detailed:
- Strict – Any compatible or incompatible changes result in a new version of
the service contract. This approach does not support backwards or forwards
- Flexible – Any incompatible change results in a new version of the service contract
and the contract is designed to support backwards compatibility but not forwards
- Loose – Any incompatible change results in a new version of the service contract
and the contract is designed to support backwards compatibility and forwards
Chapter 21 - Versioning WSDL Definitions
In this chapter, the authors deal with versioning of WSDL definition documents using the “significance of change” approach and the documentation element. Beside versioning the entire document, the book contains examples of versioning the operations definitions, the port type definitions, and the concrete descriptions.
Chapter 22 - Versioning Message Schemas
The XML Schema definitions contained by a service contract represent the basis for input, output and fault messages exchanged during service use. As a consequence, the authors consider that XML Schema definitions are most often subject to change and in need of versioning.
The chapter explains what XML Schema components are, their content sets, and the effects of adding/removing/renaming/modifying components and their relationship to versions. The authors also explain how changes of the XML Schema target namespaces affect the WSDL target namespaces and how to apply strict, flexible and loose versioning in such cases.
These chapters are excerpted from the book Web Service Contract Design and Versioning for SOA, authored by Thomas Erl, Anish Karmarkar, Priscilla Walmsley, Hugo Haas, Umit Yalcinalp, Canyang Kevin Liu, David Orchard, Andre Tost and James Pasley, published Sept. 2008 by Prentice Hall Professional as part of The Prentice Hall Service-Oriented Computing Series from Thomas Erl, ISBN 013613517X, Copyright 2009 SOA Systems Inc. For more info, please visit informit.com/soa or soabooks.com
Sadly, the number of pages accurately reflects the apalling complexity of XML-Schema + WSDL + versioning. I thank the authors for nailing down all aspects of this terrible subject.
Personally, I buried my optimism about the ambitions of developers to get a grip on all that. Ask anyone about the "unique particle rule". Or try to explain why naive XML-Schema-based web services are a very tight coupling, so much in conflict with the brainwashing SOA propaganda that is running for years now.
I see naive webservice/schema implementations all over the place, because those are easy to find with Google (that's how we learn new technology these days!), quick to implement, and they get the job done at least for short term. I am tired of arguing against this.
You should start by defining what you mean by a "RESTful" "Service". There is no notion of service in Roy's REST, let alone versioning.
I would actually argue that since the interface to a resource is uniform, why would you even need to version that interface? That sounds like an oxymoron.
I handle REST versioning via content negotiation with a version embedded in the mime-type. I came to this solution after doing a lot of Googling. There wasn't a clear winner as far as a standard stating "thou shalt do this". Which is why I asked the question in the first place. There are probably other ways, but this one seemed most clear and maintainable to me.
yes, the only problem with that approach is the combinatory problem of Mime Types x Versions x Who knows what else. The content negotiation was never designed to handle versioning.
Unfortunately, since REST couples access with identity, you are out of luck, you are stuck with this kludge. One day you will appreciate the ability to assign a particular version to a single endpoint, independent of any resource identity.
yes, the only problem with that approach is the combinatory problem of Mime Types x Versions x Who knows what else.
As opposed to interface versioning x verions x who knows what else (read policies, protocols)?
I ask any colleague who is about to design a schema to read those chapters. It is the completest and most concise source I know.
I like the book, however I find the subject disgusting :-)
Yes, that is a way I've seen in several discussions, and it sees has some drawbacks.
But Jean-Jacques is right in the "RESTful" "Service" sense of what you are looking for. A service has some particularities, that will provide enough for a long discussion on how a Service can be made RESTful.
The most common confusion is that service consumption is just an RPC call. For that part, a RESTFul service is then an RPC call that is made in a RESTful way? We have problems there since REST is not about RPC. Actually, many so called RESTFul API were discredited as such by Roy himself because they were plain RPC calls.
Now, if you go the right way, a service being a business functionality that can be consumed sending asynchronous messages to it with documents, then we hit another wall there, since REST in its HTTP implementation, uses actual operations that are synchronous.
If you solve those conceptual issues, then you may be able to apply the considerations of the book about versioning, or you may find out REST may manage that easier due to hypermedia state control.
adding an optional element may not be backward compatible