There are lots of different ways to indicate versions for schemas, and you’re not sure which, if any, is most appropriate in an SOA context.
Strongly consider using some part of the namespace to indicate the schema version. This supports the canonical data model pattern. You must do so in a way that does not disrupt tools that perform code generation, however.
Your XML schemas will evolve over time, even those in your canonical model that you hope to change only infrequently, so you need a strategy for versioning your schemas that will support your work on a practical level within an SOA. There are a few options, which we’ll discuss here.
The most straightforward way to version a schema is to use the built-in attribute that exists just for this purpose. It looks like this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0.0">
The chief benefit of versioning this way is that it’s easy and doesn’t require any additional work. It is also advantageous because if the existing schema or WSDL that imports the versioned schema is compatible with the new version, it doesn’t need to change.
But, as with so many easy things, it doesn’t really get us what we want. The downside is that it is not enforceable by tools. Moreover, it is not clear from an importing artifact (such as a WSDL or another schema) what version you are using unless you also represent the version in the location of the physical document. This ...