59 lines
3.5 KiB
HTML
59 lines
3.5 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
||
|
|
||
|
<title>Publish Web Services Description Language files through a URL</title>
|
||
|
</head>
|
||
|
|
||
|
<BODY>
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
<h3><a name="wswsdlpuburl"></a>Publish Web Services Description Language files through a URL</h3>
|
||
|
|
||
|
<p>The files that are referenced by the <wsdl-file> element in the webservices.xml deployment descriptor file can or cannot import other Web Services Description Language (WSDL) or XML schema definition (XSD) files. Typically, all WSDL or XSD files are originally placed into the WEB-INF/wsdl directory when using Java beans. If your WSDL or XSD files are not placed in this directory, the file that is referenced by the <wsdl-file> element and its imported files are located in the same directory and copied to the <tt>wsdl</tt> directory for publishing purposes.</p>
|
||
|
|
||
|
To publish a WSDL file through a URL, follow these steps:
|
||
|
|
||
|
<ol>
|
||
|
<li><p><strong>Retrieve the outermost WSDL file.</strong>
|
||
|
<br>The outermost WSDL file is the WSDL file defined by the <wsdl-file> element in the webservices.xml file.</p>
|
||
|
<p>Each Web service has an endpoint address, such as <tt>http://example.com/services/stockquote</tt>, for example. You can retrieve the outermost WSDL file (defined by the <wsdl-file> element within the webservices.xml file) by appending the endpoint address with <tt>/wsdl</tt> or <tt>/wsdl/</tt>, for example, <tt>http://example.com/services/stockquote/<strong>wsdl</strong></tt>.</p></li>
|
||
|
|
||
|
<li><p><strong>Retrieve the imported WSDL files.</strong>
|
||
|
<br>When the outermost WSDL file imports other WSDL or XSD files, these imported files can be retrieved by appending the relative path to the URL, which is used to retrieve the outermost WSDL file. This is also true for WSDL files that import other files. This process is similar to typical HTTP protocol. If an HTML document contains a hyperlink to other documents, the relative path is appended to create the URL to access the hyperlinked documents.</p></li>
|
||
|
</ol>
|
||
|
|
||
|
<p><strong>Example</strong></p>
|
||
|
|
||
|
<p>Suppose you have an application with the following directory structure:
|
||
|
<pre><em>module-root</em>/
|
||
|
WEB-INF/
|
||
|
webservices.xml
|
||
|
web.xml
|
||
|
ibm-webservices-bnd.xml
|
||
|
<em>jaxrpc-mapping-file</em>
|
||
|
wsdl/
|
||
|
myServiceImpl.wsdl
|
||
|
myService.wsdl
|
||
|
myServiceTypes.xsd</pre>
|
||
|
|
||
|
<ul>
|
||
|
<li>The webservices.xml file defines the myService service, and the <wsdl-file> element points to /wsdl/myServiceImpl.wsdl.</li>
|
||
|
<li>The myServiceImpl.wsdl file imports myService.wsdl, which is an interface. This file is the outermost WSDL file.</li>
|
||
|
<li>The myService.wsdl file imports the type definition for the interface.</li>
|
||
|
</ul>
|
||
|
<p>If the SOAP address for the myService service is http://examples.com:9080/services/myService, you can retrieve the outermost WSDL with the this URL:</p>
|
||
|
<pre>http://examples.com:9090/services/myService/wsdl</pre>
|
||
|
<p>The URL is redirected to http://examples.com:9090/services/myService/wsdl/myServiceImpl.wsdl.</p>
|
||
|
|
||
|
<p>In this example, the myServiceImpl.wsdl file includes this <import> element:</p>
|
||
|
<pre><import namespace="http://examples.com/myService" location="a/b/myService.wsdl></pre>
|
||
|
<p>To obtain the myService.wsdl file, use this URL:</p>
|
||
|
<pre>http://examples.com:9090/services/myService/wsdl/a/b/myService.wsdl</pre>
|
||
|
|
||
|
</body>
|
||
|
</html>
|