134 lines
9.2 KiB
HTML
134 lines
9.2 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>The WSDL2Java script</title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h3><a name="qshwsdl2java"></a>The WSDL2Java script</h3>
|
|
|
|
<p>The WSDL2Java command tool creates Java classes and deployment descriptor templates from a WSDL file. See <a href="wsdevmap.htm">Map between Java, WSDL, and XML</a> for more information.</p>
|
|
|
|
<p><strong>Note:</strong> In WebSphere Application Server - Express Version 5.1.1 and later, the WSDL2Java command recognizes and processes non-SOAP ports and bindings that are found in the WSDL file.</p>
|
|
|
|
<p><strong>Classes and files generated</strong></p>
|
|
|
|
<p>The WSDL2Java script generates these kinds of classes and files:</p>
|
|
|
|
<ul>
|
|
<li><p>For each portType in the WSDL document (<wsdl:portType> element tag):</p>
|
|
<ul>
|
|
<li>Service Endpoint Interface</li>
|
|
</ul><p></p></li>
|
|
|
|
<li><p>For each service in the WSDL document (<wsdl:service> element tag):</p>
|
|
<ul>
|
|
<li>Service Interface when the -role develop-client argument is specified.</li>
|
|
<li>ServiceLocator when the -role deploy-client argument is specified.
|
|
<br>This class is a WebSphere product-specific implementation of the service interface, and is not used directly.
|
|
<br><strong>Note:</strong> For Version 5.1.1 and later, the ServiceLocator also supports non-SOAP ports and bindings.</li>
|
|
<li>ServiceInformation when the -role deploy-client argument is specified.</li>
|
|
<li>webservices.xml deployment descriptor template when the -role develop-server argument is specified.</li>
|
|
<li>ibm-webservices-bnd.xmi deployment descriptor template when the -role develop-server argument is specified.</li>
|
|
<li>ibm-webservices-ext.xmi deployment descriptor template when the -role develop-server argument is specified.</li>
|
|
<li>wsdlfile_mapping.xml JAX-RPC mapping file when the -role develop-client or -role develop-server is specified.</li>
|
|
<li>webservicesclient.xml deployment descriptor template when the -role develop-client argument is specified.</li>
|
|
<li>ibm-webservicesclient-bnd.xmi deployment descriptor template when the -role develop-client argument is specified.</li>
|
|
<li>ibm-webservicesclient-ext.xmi deployment descriptor template when the -role develop-client argument is specified.</li>
|
|
</ul>
|
|
<p>When the role is a server role, the container argument specifies which J2EE container the implementation uses. When the -role develop-server -container web arguments are specified, the files are generated into the WEB-INF directory.</p></li>
|
|
|
|
<li><p>For each binding in the WSDL file (<wsdl:binding> element tag):</p>
|
|
<ul>
|
|
<li>A stub generates that implements the Service Endpoint Interface(deploy-client role).</li>
|
|
<li>An implementation template for the Java bean generates when the -role develop-server and -container-web arguments are specified.</li>
|
|
</ul><p></p></li>
|
|
|
|
<li><p>Other classes and files:</p>
|
|
<ul>
|
|
<li>A Java bean representing the structure of the type when the -role develop-server or -role develop-client arguments are specified for each complexType or simpleType.</li>
|
|
<li>Three classes, *_Ser.java, *_Deser.java, and *_Helper.java, generate for each complexType to assist in converting the bean to Simple Object Access Protocol (SOAP) and back when the -role deploy-server or -role deploy-client argument is specified.</li>
|
|
<li>A *Holder.java class generates when the -role develop-server or -role develop-client arguments are specified for each out and inout parameter.</li>
|
|
</ul><p></p></li>
|
|
</ul>
|
|
|
|
<p><strong>Authority</strong></p>
|
|
<p>To run this script, your user profile must have *RX authority.</p>
|
|
|
|
<p><strong>Syntax</strong></p>
|
|
<p>The syntax of the script is:</p>
|
|
|
|
<pre>WSDL2Java <em>WSDL-URI</em> [arguments]</pre>
|
|
|
|
<p><strong>Parameters</strong></p>
|
|
<p>The parameters of the script are:</p>
|
|
|
|
<ul>
|
|
<li><p><strong><em>WSDL-URI</em></strong>
|
|
Specifies the location of the input WSDL document using a Universal Resource Identifier (URI). You can also use a regular file path if the WSDL file is on the local file system.</p></li>
|
|
|
|
<li><p><strong>-container</strong>
|
|
<br>This is an optional parameter. The value <em>j2ee-container</em> specifies the J2EE container to be used. Valid values are client, web, and none. If client is role, the default argument is none. If server is role, the container must be web. The same container option must be used for both development and deployment.</p></li>
|
|
|
|
<li><p><strong>-deployScope</strong>
|
|
<br>This is an optional parameter. The value <em>scope</em> specifies how to deploy the server implementation. These are the valid values:</p>
|
|
<ul>
|
|
<li>Application - Uses one instance of the implementation class for all requests.</li>
|
|
<li>Request - Creates a new instance of the implementation class for each request.</li>
|
|
</ul><p></p></li>
|
|
|
|
<li><p><strong>-genResolver</strong>
|
|
<br>Generates an absolute-import resolver class. The purpose of this class is to record the contents of the imported WSDL files used by the WSDL URI. This class is used by the runtime. It can also be used for future WSDL2Java command runs. This is desirable when the imported WSDL files are remote and can be inaccessible or slow to access. It also eliminates the possibility that a remote WSDL file might have different contents at run time than it did at development time. The generated class is named _AbsoluteImportResolver.java. You should compile and package this class with the other Java classes generated by the WSDL2Java command.</p></li>
|
|
|
|
<li><p><strong>-help</strong>
|
|
<br>Displays a help message.</p></li>
|
|
|
|
<li><p><strong>-helpX</strong>
|
|
<br>Displays a help message for extended options.</p></li>
|
|
|
|
<li><p><strong>-inputMappingFile</strong>
|
|
<br>This is an optional parameter. The value <em>mapfile</em> specifies the file name of the Java to WSDL mapping file. If the input WSDL file is generated from Java code by the Java2WSDL command or another vendor tool by following the JAX-RPC standard, a mapping file is also generated. By supplying the inputMappingFile, you ensure the Java classes generated by the WSDL2Java command are compatible with the Java classes originally used to generate the WSDL file. </p></li>
|
|
|
|
<li><p><strong>-NStoPkg</strong> <!-- <em>namespace</em>=<em>package</em> -->
|
|
<br>This is an optional parameter. If you specify this parameter, the script maps the namespace specified by <em>namespace</em> to the package specified by <em>package</em>. Specify this parameter once for each unique namespace mapping. For example, if there is a namespace in the WSDL file called urn:AddressFetcher2, and you want files generated from the objects in this namespace to reside in the package samples.addr, provide the -NStoPkg urn:AddressFetcher2=samples.addr argument to the WSDL2Java command. By default, package names are automatically derived from the namespace strings in the WSDL file. For example, if the namespace is of the form http://x.y.com or urn:x.y.com, the corresponding package is com.y.x.</p>
|
|
<p><strong>Note:</strong> The default XML namespace to Java package mapping does not take the context root into account. If two namespaces are the same up to the first slash, they are mapped to the same Java package. For example, the XML namespaces http://www.ibm.com/foo and http://www.ibm.com/bar both map to the Java package com.ibm.www. Use the -NStoPkg option to specify the package for the fully qualified namespace.</p></li>
|
|
|
|
<li><p><strong>-output</strong>
|
|
<br>This is an optional parameter. The value <em>directory</em> sets the root directory for the files that the script generates.</p></li>
|
|
|
|
<li><p><strong>-role</strong>
|
|
<br>This is an optional parameter. The value <em>j2eeRole</em> specifies the J2EE development role that identifies which files to generate. Valid values are:</p>
|
|
<ul>
|
|
<li><strong>client</strong>
|
|
<br>Combination of develop-client and deploy-client.</li>
|
|
<li><strong>deploy-client</strong>
|
|
<br>Generates binding files for client deployment.</li>
|
|
<li><strong>deploy-server</strong>
|
|
<br>Generates binding files for server deployment.</li>
|
|
<li><strong>develop-client</strong> (default)
|
|
<br>Generates files for client development. This is the default value.</li>
|
|
<li><strong>develop-server</strong>
|
|
<br>Generates files for server development.</li>
|
|
<li><strong>server</strong>
|
|
<br>Combination of develop-server and deploy-server.</li>
|
|
</ul><p></p></li>
|
|
|
|
<li><p><strong>-timeout</strong>
|
|
<br>This is an optional parameter. The value <em>seconds</em> specifies how long the WSDL2Java command should wait, in seconds, for the WSDL-URI to respond before giving up. The default is 45 seconds, -1 disables the timeout.</p></li>
|
|
|
|
<li><p><strong>-useResolver</strong>
|
|
<br>This is an optional parameter. The value <em>resolver-class</em> specifies an absolute-import resolver class to use during parsing. This class must have been created during a previous execution of the WSDL2Java command using the -genResolver option. The class must be available in CLASSPATH.</p></li>
|
|
|
|
<li><p><strong>-verbose</strong>
|
|
<br>Displays processing information, including the names of the generated files.</p></li>
|
|
</ul>
|
|
|
|
</body>
|
|
</html>
|