Java Reference
In-Depth Information
Transparently Substituting XML Files
Problem
Your code refers to XML documents such as WSDL or XML Schema using remote addresses,
but you want your code to automatically and transparently substitute a saved local copy of the
remote resource. Or, you have defined a placeholder location for a WSDL, and you want to
substitute a real value at runtime.
Solution
Use an XML catalog.
Discussion
An XML Catalog consists of one or more files that define a logical structure that maps a set of
XML entities. XML catalogs cover two basic scenarios: mapping an external entity's public
or system identifier to a URI, and mapping one URI reference to another one.
XML catalogs are useful for a few reasons:
Disconnected access
Disconnected access
XML catalogs allow your application to continue working even if you are disconnected
from the network that defines the remote resource. If you're using your laptop in a dis-
connected location and you are developing a web service that uses schemas that are back
in the office, you can use an XML catalog to substitute those remote schemas for local
copies. You can then continue to develop without having to change code throughout your
application that points to those remote resources.
Performance
Performance
XML catalogs are also important for performance reasons. Your application can use cata-
logs to avoid making expensive remote calls to WSDL documents.
Software development life cycle
Software development life cycle
When moving code through development, QA, staging, and production, you may find it
useful to employ XML catalogs in resolving new QA entities that map to existing pro-
duction resources, for example. Depending on how your environment is configured, XML
catalogs could also be useful on large teams.
Search WWH ::




Custom Search