Java Reference
In-Depth Information
NOTE
Don't map the same entry to different resources. The first one the engine finds will always be the one
it uses.
Here is an example. Say that you have a WSDL at http://localhost:8080/soaCook-
bookWS/CatalogServiceSN?wsdl . You have a separate project that implements a client
based on this WSDL, and you do not want your application to invoke the remote resource
every time the WSDL is encountered in your client code. Define an XML catalog to map this
WSDL location to a local copy of the WSDL you store with your client deployment artifact.
You can first save a local copy of the WSDL (and any external schemas that it imports) to a
directory named src/xml. You'll then have your build script include the WSDL and schemas
in the WEB-INFdirectory at deploy time.
NOTE
Here I am using an example of mapping remote to local documents, but this is not the only way to
use catalogs; you can also just map one XML document to another that redefines it.
The generated web service client will define annotations like this:
@WebServiceClient(name="CatalogServiceSN",
targetNamespace = "http://ns.soacookbook.com",
wsdlLocation = "http://localhost:8080/soaCookbookWS/
CatalogServiceSN?wsdl")
public class CatalogServiceSN extends Service { ... }
So the catalog file that you'll use will replace the WSDL file and the single schema (defining
the getTitle and getTitleResponse elements) that it imports. This is shown in
Example 3-15 .
Example3-15.XML Catalog using system
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
prefer="system">
<system systemId="http://localhost:8080/soaCookbookWS/
CatalogServiceSN?wsdl"
uri="src/xml/CatalogServiceSN.wsdl"/>
<system systemId="http://localhost:8080/soaCookbookWS/Library.xsd"
uri="src/xml/Library.xsd"/>
</catalog>
Search WWH ::




Custom Search