Databases Reference
In-Depth Information
Changing schema location
Encode the schema version in the filename of the schema; for example, we have
named our auction schema Auction_v1_0.xsd . Whenever we import a schema,
either in another schema or within a WSDL document, the schemaLocation attribute
will contain the version of the schema being used.
This has two advantages, we can immediately see what version of a schema
a web service is based on, simply by looking at what files we are importing
within the WSDL. Additionally, it allows us to have multiple versions of a
schema deployed side-by-side allowing each service to upgrade to a newer
version of a schema as it suits them.
When we upgrade a service to use the new version of a schema, then of
course we will have a corresponding new version of the service.
Updating schema version attribute
Use the schema version attribute to document the version of the schema. Note that
this is purely for documentation, as there is no processing of this attribute by the
parser. This ensures that if the schema is renamed so as to remove the encoding of
the schema version from the filename, we still know the version of that schema.
Resisting changing the schema namespace
One common practice is to embed the version of the schema within its namespace,
and update the namespace for new versions of the schema. However, this has the
potential to cause major change to both consumers and providers of a service, so I
would strongly recommend that you use this approach with care, if at all.
Firstly, when you change the namespace of a schema, it is no longer backward
compatible with previous versions of the schema. So by definition, changing
the namespace is a major change in its own right. Therefore, never change the
namespace for a minor change.
For major changes, changing the namespace would seem a very valid approach, as
apart from being a clear indication to the client that we have introduced a service
that is not backward compatible, it will prevent you from successfully calling any of
the operations provided by the new version of the service.
However, it is important to understand the magnitude of this change, as it will
typically break a number of components on both the client and service provider.
For example, all your XPath assignments and XSLT transformations will have to
be updated to use the new namespace. Therefore, implementing the change will be
more time-consuming.
 
Search WWH ::




Custom Search