Develop Web service deployment descriptor templates from the WSDL file

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:

file:/path/file_name.wsdl

where path is the directory path that contains the file, and file_name is the name of the wsdl file. You can also specify local files using the absolute or relative file system path.

To develop deployment descriptor templates, run the WSDL2Java command at a command prompt.

In these commands, type is Web for a Java bean-based implementation, and wsdlURL 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.

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.

If the -verbose option is specified, the command displays a list of all generated files.

Examples

The following example uses a WSDL file named AddressBookJ2WB.wsdl:

Generate the template files:

WSDL2Java -verbose -role develop-client -container Web -genJava No META-INF\AddressBookJ2WB.wsdl

The deployment descriptor templates are generated into the WEB-INF for client subdirectories as follows:

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