Develop Web services deployment descriptor templates for a Java bean implementation
To develop the Java bean implementation templates and bindings from a WSDL file, obtain the Uniform Resource Locator (URL) of the WSDL file to use.If it is a local file and you are running the Windows platform, the URL looks like this: file:drive:\path\file_name.wsdl. If you are using the UNIX platform, the URL looks like this: file:/path/file_name.wsdl. You can also specify local files using the absolute or relative file system path.
Implementation templates are generated using the -role develop-server option of the WSDL2Java command. The WSDL2Java command also generates bindings and deployment descriptors. To develop Java bean implementation templates and bindings from a WSDL file...
- Run the WSDL2Java -verbose -role develop-server -container web wsdlURL command. Since the verbose option is specified, a list of all generated files is displayed when the command runs.
Templates for the implementation and deployment descriptors required to implement a Web service, as well as bindings files. These templates are partially filled with information from the WSDL file.
Usage Scenario
The following example uses an Java bean named AddressBook and a WSDL file named AddressBook.wsdl. After generating the template files from the WSDL2Java -verbose -role develop-server -container web AddressBook.wsdl command, the following files are generated:
Parsing XML file: file:e:/example/app/topdown/step1/AddressBook.wsdl WSWS3185I: Info: Parsing XML file: AddressBook.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 WEB-INF\webservices.xml. WSWS3282I: Info: Generating WEB-INF\ibm-webservices-bnd.xmi. WSWS3282I: Info: Generating WEB-INF\AddressBook_mapping.xml. WSWS3282I: Info: Generating WEB-INF\ibm-webservices-ext.xmi.The generated file named AddressBookSOAPBindingImpl.java is the template for the implementation bean. It is named after the port in the WSDL file. Generally, this class is renamed to a more meaningful name.
Complete the Java bean implementation.
See Also
Completing the Java bean implementation
Developing a new Web service with an existing WSDL file using a Java bean