66 lines
3.4 KiB
HTML
66 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>Develop Web service deployment descriptor templates from the WSDL file</title>
|
||
|
</head>
|
||
|
|
||
|
<BODY>
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
<h3><a name="wsdevddtemp"></a>Develop Web service deployment descriptor templates from the WSDL file</h3>
|
||
|
|
||
|
<p>To develop the deployment descriptor templates from a Web Services Description Language (WSDL) file, you must obtain the Uniform Resource Locator (URL) of the WSDL file to use. If it is a local file, the URL has this format:</p>
|
||
|
<pre>file:/<em>path</em>/<em>file_name</em>.wsdl</pre>
|
||
|
<p>where <em>path</em> is the directory path that contains the file, and <em>file_name</em> is the name of the wsdl file. You can also specify local files using the absolute or relative file system path.</p>
|
||
|
|
||
|
<p>To develop deployment descriptor templates, run the WSDL2Java command at a command prompt.</p>
|
||
|
<ul>
|
||
|
<li><p>For a J2EE Web services application, run this command:</p>
|
||
|
<pre>WSDL2Java -verbose -role develop-server -container <em>type</em> -genJava No <em>wsdlURL</em></pre>
|
||
|
<p>This command generates the server deployment descriptor files in the WEB-INF subdirectory:</p>
|
||
|
<ul>
|
||
|
<li>webservices.xml</li>
|
||
|
<li>ibm-webservices-bnd.xmi</li>
|
||
|
</ul><p></p></li>
|
||
|
|
||
|
<li><p>For a Web services client, run this command:</p>
|
||
|
<pre>WSDL2Java -verbose -role develop-client -container <em>type</em> -genJava No <em>wsdlURL</em></pre>
|
||
|
<p>This command generates the client deploment descriptor files in the WEB-INF subdirectory:</p>
|
||
|
<ul>
|
||
|
<li>webservicesclient.xml</li>
|
||
|
<li>ibm-webservicesclient-bnd.xmi</li>
|
||
|
</ul><p></p></li>
|
||
|
</ul>
|
||
|
|
||
|
<p>In these commands, <em>type</em> is <tt>Web</tt> for a Java bean-based implementation, and <em>wsdlURL</em> is the URL of the WSDL file. The value that you specify for the -container parameter determines to which subdirectory the templates are generated. When -container Web parameter is specified, all deployment descriptors and the JAX-RPC mapping file are generated into the WEB-INF subdirectory of the output directory.</p>
|
||
|
|
||
|
<p>The Java API for XML-based remote procedure call (JAX-RPC) mapping file is needed for both server and client use, and is generated by default when you run the WSDL2Java command. To generate the deployment descriptors only, and not any Java classes, specify the -genJava No parameter with the WSDL2Java command tool.</p>
|
||
|
|
||
|
<p>If the -verbose option is specified, the command displays a list of all generated files.</p>
|
||
|
|
||
|
<p><strong>Examples</strong></p>
|
||
|
|
||
|
<p>The following example uses a WSDL file named AddressBookJ2WB.wsdl:</p>
|
||
|
<p>Generate the template files:</p>
|
||
|
|
||
|
<pre>WSDL2Java -verbose -role develop-client -container Web -genJava No
|
||
|
META-INF\AddressBookJ2WB.wsdl</pre>
|
||
|
|
||
|
|
||
|
<p>The deployment descriptor templates are generated into the WEB-INF for client subdirectories as follows:</p>
|
||
|
|
||
|
<pre>Parsing XML file: META-INF/AddressBookJ2WB.wsdl
|
||
|
Generating: WEB-INF\webservicesclient.xml
|
||
|
Generating: WEB-INF\ibm-webservicesclient-bnd.xmi
|
||
|
Generating: WEB-INF\AddressBookJ2WB_mapping.xml
|
||
|
Generating: META-INF\webservices.xml
|
||
|
Generating: META-INF\ibm-webservices-bnd.xmi
|
||
|
Generating: META-INF\AddressBookJ2WB_mapping.xml</pre>
|
||
|
|
||
|
</body>
|
||
|
</html>
|