Develop implementation templates, deployment descriptor templates, and bindings from a 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 generate implementation templates, bindings, and deployment descriptors, specify the -role develop-server parameter and the -container parameter when you run the WSDL2Java command:

WSDL2Java -verbose -role develop-server -container type wsdlURL

where 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.

For an EJB implementation, the WSDL2Java command generates templates for the following:

If you specify the verbose parameter, the command displays a list of all generated files

Example

This example uses an enterprise bean named AddressBook and a WSDL file named AddressBook.wsdl.

WSDL2Java -verbose -role develop-server -container EJB AddressBook.wsdl

Parsing XML file:  file:e:/example/app/topdown/step1/AddressBook.wsdl
WSWS3185I: Info: Parsing XML file:  AddressBookW2JB.wsdl
WSWS3282I: Info: Generating addr\Address.java.
WSWS3282I: Info: Generating addr\Phone.java.
WSWS3282I: Info: Generating addr\StateType.java.
WSWS3282I: Info: Generating addr\AddressBook.java.
WSWS3282I: Info: Generating addr\AddressBookSoapBindingImpl.java.
WSWS3282I: Info: Generating addr\AddressBook_RI.java.
WSWS3282I: Info: Generating addr\AddressBookHome.java.
WSWS3282I: Info: Generating META-INF\webservices.xml.
WSWS3282I: Info: Generating META-INF\ibm-webservices-bnd.xmi.
WSWS3282I: Info: Generating META-INF\AddressBookW2JB_mapping.xml.
WSWS3282I: Info: Generating META-INF\ibm-webservices-ext.xmi.

To generate files for a Java bean implementation, run this command:

WSDL2Java -verbose -role develop-server -container Web AddressBook.wsdl