ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzamy_5.4.0.1/50/webserv/qshjava2wsdl.htm

144 lines
9.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>The Java2WSDL script</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h3><a name="qshjava2wsdl"></a>The Java2WSDL script</h3>
<p>The Java2WSDL command tool maps a Java class to a Web Services Description Language (WSDL) file by following the Java API for XML-based remote procedure call (JAX-RPC) specification. The Java2WSDL command accepts a Java class as input and produces a WSDL file representing the input class. If there is an existing file at the output location, it is overwritten. The WSDL file generated by the Java2WSDL command contains WSDL and XML schema constructs that are automatically derived from the input class. You can override these default values with command-line arguments.</p>
<p>The WSDL file generated by the Java2WSDL command can contain unexpected elements. You can create WSDL files that cannot be compiled when regenerated into Java code using the WSDL2Java command because the JAX-RPC mapping from Java to WSDL is not reversible back to the original Java code. Inspect and modify the WSDL file if you encounter this problem.</p>
<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>Java2WSDL class [argument...]</pre>
<p><strong>Parameters</strong></p>
<p>The parameters of the script are:</p>
<ul>
<li><p><strong><em>class</em></strong>
<br>This is a required parameter. The value <em>class</em> represents the fully qualified name of one of the following Java classes:</p>
<ul>
<li>Service Endpoint Interface that extends the java.rmi.Remote class</li>
<li>Java bean</li>
</ul>
<p>The Java2WSDL command locates the class in CLASSPATH.</p></li>
<li><p><strong>-bindingName</strong>
<br>This is an optional parameter. The value <em>name</em> specifies the name to use for the binding element. If not specified, the binding name is the portTypeName.</p></li>
<li><p><strong>-help</strong>
<br>Displays the help message.</p></li>
<li><p><strong>-helpX</strong>
<br>Displays the help message for extended options.</p></li>
<!--HelpXoptions-->
<li><p><strong>-debug</strong>
<br>Displays debug messages.</p></li>
<li><p><strong>-outputImpl</strong>
<br>This is an optional parameter. The value <em>impl-wsdl</em> specifies if you want an interface and implementation WSDL file emitted.</p></li>
<li><p><strong>-locationImport</strong>
<br>This is an optional parameter. The value <em>location-uri</em> specifies the location of the interface WSDL file if you use the -outputImpl argument specified.
<li><p><strong>-MIMEStyle</strong>
<br>This is an optional parameter. The value <em>style</em> specifies a style representing Multipurpose Internet Mail Extensions (MIME) information. Valid values are Axis and WSDL11. The default value is WSDL11.</p></li>
<li><p><strong>-soapAction</strong>
<br>This is an optional parameter. Valid arguments are:</p>
<ul>
<li><strong>DEFAULT</strong>
<br>Sets the soapAction field according to deployment information.</li>
<li><strong>NONE</strong>
<br>Sets the soapAction field to &quot;&quot;.</li>
<li><strong>OPERATION</strong>
<br>Sets the soapAction field to the operation name.</li>
</ul><p></p></li>
<li><p><strong>-stopClasses</strong>
<br>This is an optional parameter. If the -all argument is specified, the Java2WSDL command searches inherited classes and interfaces to construct the list of methods for WSDL file operations. The Java2WSDL command searches inherited classes and interfaces when generating extended complexTypes. The search stops when a class or interface is found within a package that begins with java or javax. The value <em>parent</em> specifies an additional class that cause the search to stop. To specify multiple classes, separate them with commas:</p>
<pre>-stopClasses <em>class1</em>,<em>class2</em></pre></li>
<li><p><strong>-namespaceImpl</strong>
<br>This is an optional parameter. The value <em>namespace</em> specifies the target namespace for the implementation WSDL if -outputImpl specified.</p></li>
<li><p><strong>-voidReturn</strong>
<br>Valid arguments are:</p>
<ul>
<li><strong>ONEWAY</strong>
<br>Methods with void returns are one-way.</li>
<li><strong>TWOWAY</strong>
<br>Methods with void returns are two-way. This the default for HTTP transport.</li>
</ul><p></p></li>
<li><p><strong>-wrapped</strong>
<br>This is an optional parameter. The value <em>boolean</em> specifies if the WSDL file should be generated according to wrapped rules. This is only valid if the value of the -use parameter is LITERAL. The option defaults to true.</p></li>
<li><p><strong>-extraClasses</strong>
<br>This is an optional parameter. The value <em>classes</em> specifies other classes that should be represented in the WSDL file.</p></li>
<li><p><strong>-input</strong>
<br>This is an optional parameter. The value <em>wsdl-uri</em> specifies the input WSDL file used to build an output WSDL file. Information from an existing WSDL file, whose name is specified in this option, is used with the input Java class to generate the desired output.</p></li>
<li><p><strong>-implClass</strong>
<br>This is an optional parameter. The Java2WSDL command uses method parameter names to construct the WSDL file message part names. The command automatically obtains the message names from the debug information in the class. If the class is compiled without debug information, or if the class is an interface, the method parameter names are not available. The value <em>impl-class</em> specifies an alternative class from which to obtain method parameter names. The specified class does not need to implement the class if the class is an interface, but it must implement the same methods as class.</p></li>
<li><p><strong>-location</strong>
<br>This is an optional parameter. The value <em>location</em> specifies the location or Uniform Resource Locator (URL) of the service. Typically, this value fills automatically when the Web service deploys. Use this argument to specify the location if you want to generate a WSDL file containing a location URL without deploying. A warning displays to remind you that the generated WSDL file should not be published if the final location is not yet been determined. The name after the last slash or backslash is the name of the service port, unless the name is overridden by the -servicePortName argument. The service port address location attribute is assigned the specified value.</p></li>
<li><p><strong>-namespace</strong>
<br>This is an optional parameter. The value <em>targetNamespace</em> specifies the target namespace for the WSDL file being generated.</p></li>
<li><p><strong>-output</strong>
<br>This is an optional parameter. The value <em>wsdl-uri</em> specifies the path and file name of the output WSDL file. If not specified, the default file, class.wsdl, is written into the current directory.</p><li>
<li><p><strong>-PkgtoNS</strong> <!-- <em>package</em>=<em>namespace</em> -->
<br>This is an optional parameter. If you specify this parameter, the script maps the package specified by <em>package</em> to the namespace specified by <em>namespace</em>. If there is a package without a namespace, the Java2WSDL command generates a namespace name. Specify this parameter once for each mapping.</p></li>
<li><p><strong>-portTypeName</strong>
<br>This is an optional parameter. The value <em>name</em> specifies the name to use for the portType element. If not specified, the class name is used.</p></li>
<li><p><strong>-serviceElementName</strong>
<br>This is an optional parameter. The value <em>name</em> specifies the name of the service element.</p></li>
<li><p><strong>-servicePortName</strong>
<br>This is an optional parameter. The value <em>name</em> specifies the name of the service. If not specified, the service name is derived from the -location parameter.</p></li>
<li><p><strong>-style</strong>
<br>This is an optional parameter. The value <em>style</em> specifies the WSDL style to use in the generated WSDL file. Valid values are RPC and DOCUMENT. This parameter is used with the -use parameter.</p>
<ul>
<li>If RPC is specified with -use ENCODED, or omitting use, a style=rpc/use=encoded WSDL file is generated.</li>
<li>If RPC is specified with -use LITERAL, a style=rpc/use=literal WSDL file is generated.</li>
<li>If DOCUMENT is specified with -use LITERAL or omitting use, a style=document/use=literal WSDL file is generated.</li>
</ul>
<p>For more information about styles, see <a href="wsdevmap.htm">Mapping between Java, WSDL and XML</a>.</p></li>
<li><p><strong>-transport</strong>
<br>This is an optional parameter. The value <em>transport_type</em> specifies the type of tranpsort for which the script generates Simple Object Access Protocol (SOAP) bindings. The default value is <tt>http</tt>. You can specify the transport option only once.</p></li>
<li><p><strong>-use</strong>
<br>This is an optional parameter. The value <em>use</em> specifies the <tt>use</tt> that is generated into the WSDL file. Valid values are LITERAL and ENCODED. This parameter is used with the -style parameter.</p>
<p>For more information, see <a href="wsdevmap.htm">Mapping between Java, WSDL and XML</a>.</p></li>
<li><p><strong>-verbose</strong>
<br>Displays verbose messages.</p></li>
</ul>
</body>
</html>