60 lines
3.4 KiB
HTML
60 lines
3.4 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 referenced by the <wsdl-file> element in the webservices.xml file can or cannot import other Web Services Description Language (WSDL) or 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 referenced by the <wsdl-file> and its imported files are located at the same directory and copied to the wsdl/ directory for publishing purposes.</p>
|
||
|
|
||
|
|
||
|
To publish a WSDL file through a URL, follow these steps:
|
||
|
|
||
|
<ol>
|
||
|
<li><p>Retrieve the outermost WSDL file.
|
||
|
<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, like http://example.com/services/stockquote. You can retrieve the outermost WSDL file (defined by the <wsdl-file> element within the webservices.xml file) by appending the string "/wsdl" or "/wsdl/" to the endpoint address, for example,http://example.com/services/stockquote/wsdl.</p></li>
|
||
|
|
||
|
<li><p>Retrieve the imported WSDL files.
|
||
|
<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>
|