Develop Web service deployment descriptor templates from the WSDL file

To develop the deployment descriptor templates from a WSDL file, 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 EJB for an enterprise bean-based implementation or 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:

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
WSDL2Java -verbose -role develop-server -container Ejb -genJava No META-INF\AddressBookJ2WB.wsdl

The deployment descriptor templates are generated into the WEB-INF for client and META-INF for EJB server 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