3

This question seems simple, but I couldn't find the proper place to set in a WSDL document a version to its definitions.

The objective is be able to easily see when it becomes outdated, when in the future I update it.

I'm gonna set it to 1.0. And if in the future I add a new operation to it, I set it to 1.1. Then if somebody has the 1.0 version it will be easy to see it's missing that operation definition and request to update it.

Hikari
  • 3,797
  • 12
  • 47
  • 77

1 Answers1

3

First thing to realise is that a new version of a service can be seen as a new service. Alike but different. The question then changes to "how to minimise duplication if services are similar".

As for versioning, you can use the namespace declaration (e.g. targetNamespace="mynamespace/1.0") or a <version>1.0</version> tag in (or version="1.0" attribute on) the root node of the types used for request/response messages).

Using the namespace most likely means that one implementation can only serve one version of the service. If you want a certain implementation to serve, say, version 1.0-1.3 and another 1.3+, than you will likely use the <version/> method (or @version), since in that case there is only one namespace. Implementations can than internally decide wether to process or deny based on the value of <version/>.

In a more hybrid service landscape, you can use the <version/> method to create a proxy implementation that relays to services that use the targetNamespace method. Better still would be using a UDDI for this, if you have one at your disposal.

Please consider backwards compatibility of your changes. Adding an operation, as you suggest, is fully backwards compatible. If you have a client X on version 1.0, and add an operation to you server (now 1.1), X can still call the server because all the operations X knows about are still available. (Provided you did not change the namespace to reflect the version that is (use <version/>.) The (absence of) backward compatibility of an interface is usually reflected in a changed major version number (e.g. 1.1 -> 2.0), which may cause you to realize that you could do major changes with the namespace and minor ones with a <version/> tag.

Have fun, this is interesting stuff to be working on!

jos
  • 823
  • 6
  • 8
  • Thanks, that's what I wanted to know! Could you provide an example of where can be added to keep the WSDL document valid? – Hikari Jan 15 '13 at 12:07
  • @Hikari in the elements that make up the request and/or response messages. If you have a look at Example 1 on http://www.w3.org/TR/wsdl, it could look like this: – jos Jan 15 '13 at 14:23
  • So, you suggest adding the version as a element inside each type? I'd rather not have it as a parameter in a message. I was think in something like or at least or . I just don't know which element accepts a version attribute in WSDL schema. – Hikari Jan 15 '13 at 19:52
  • It would be interesting to have the WSDL version provided in inputs and outputs, but only if the WS was very complex and be updated too often. Then, client could ask server for server's version and also client be forced to tell server its version for verification. – Hikari Jan 15 '13 at 19:53