Java Reference
In-Depth Information
because web services rely on code generated by tools. Tools such as wsimport and WSDL2Java
generate package names for the client artifacts they create from a WSDL using the namespace.
And in Java, it is illegal to begin a package name with a number.
This is easily remedied. You could do something like this:
<definitions name="MyService"
targetNamespace="http://ns.soacookbook.com/sales/v2009Q1"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.soacookbook.com/sales/v2009Q1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
Using a prefix such as “v” to indicate “version” takes care of the client-side generation prob-
lem. You don't have to use a date, of course, and can use a more standard version number.
This has the advantage of making clear in WSDLs, in importing schemas, and in generated
client code what exactly is being used. It also allows these items to continue using the version
they're compatible with until they're ready to take the update.
Because you have changed the namespace, you should create a new document based on the
new version, and keep both versions until you can update everybody. Not everything can or
should be migrated to the new schema at once.
Make sure that you decide on a single convention up-front, publish it in your developer docu-
mentation and governance guidelines, and enforce the structure you've chosen.
Search WWH ::




Custom Search