Java Reference
In-Depth Information
TIP
It is an SOA best practice in some situations to keep your XML schemas located in a central reposit-
ory. Using XML Catalogs gives you the flexibility to use such an approach practically, as they add a
layer of indirection that helps you transparently move, maintain, and scale your application compon-
ents.
JAX-WS implementations are required to support XML catalogs 1.1, which is a specification
published by OASIS. JAX-WS support comes in the form of a processing engine that reads
the catalog and resolves the location mappings. When the JAX-WS deployment encounters
a reference to an XML file for which there is an entity mapping in the catalog, the runtime
substitutes the reference name for the mapped name. Put another way, the engine receives as
input, such as a remote URL for a WSDL document that your application code refers to; the
engine checks the catalog for a mapped entry for that URL, and if it finds one, it silently sub-
stitutes the physical document that is the mapping target. This is generally how they are used
within web services, though they can be used to map replacement text for an external entity.
Using an XML catalog within a JAX-WS deployment requires a few steps:
1. Download a local copy of the remote files you want to substitute.
2. Create the XML catalog file that maps the names of the remote resources to their local
substitutes.
3. Save the file with the name jax-ws-catalog.xml.
4. Package it with your deployment artifact. If this is a WAR, place the catalog file directly
in WEB-INF. If this is an EAR, place it directly in META-INF.
NOTE
You can read the XML Catalog specification at http://www.oasis-open.org/committees/down-
load.php/14809/xml-catalogs.html . It is not very long.
XML catalog entities
XML catalogs are application independent and vendor independent. They are not Java-specif-
ic, but they are defined for use in any platform.
Search WWH ::




Custom Search