# Catalog

## Catalog Support

Often times, such as for performance reason or your application specific needs, you have a need where you want to resolve the WSDL/Schema documents resolved from the copy of it you have either bundled with your client or server or just to resolve it not from where a WSDL/schema imports points to but rather from where you want it to be picked up.

### A Sample catalog file

`jax-ws-catalog.xml`

    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
            prefer=" system">

        ...

        < system systemId=" http://foo.org/hello?wsdl" uri="HelloService.wsdl"/>
    </catalog>

#### Location of the catalog file

- For `wsimport` command-line or ant task

  - use `-catalog` option to pass the catalog file. The name of the catalog file does not matter for `wsimport` tool but for consistency you may like to call it `jax-ws-catalog.xml`

  - use

        <wsimport catalog="''>

    or

        <xmlcatalog ... />

    with `wsimport` ant task

- Client Runtime

  - `META-INF/jax-ws-catalog.xml` picked up from classpath

- Lightweight HTTP server (j2se) based endpoints

  - `META-INF/jax-ws-catalog.xml` picked up from classpath

- Servlet based endpoints or JSR 109 based Web Module

  - `WEB-INF/jax-ws-catalog.xml`

- JSR 109 based EJB Modules

  - `META-INF/jax-ws-catalog.xml`

For details on XML catalog see here.