Assemble a J2EE Web service based on an existing WSDL file

This topic explains how to assemble a Web services-enabled JAR file with command-line tools.

To assemble a Web services-enabled enterprise bean JAR file when starting from WSDL, follow these steps:

  1. Place the JAR file in the root directory.
  2. Place the WSDL file as specified by the deployment descriptor <wsdl-file> element in the META-INF/wsdl subdirectory.
  3. Place the JAX-RPC mapping file as specified by the deployment descriptor <jaxrpc-mapping-file> element in the META-INF subdirectory.
  4. Place the webservices.xml and ibm-webservices-bnd.xmi files in the META-INF subdirectory.
  5. Run this command to add these files to the enterprise bean JAR file:
    jar -uvf EAR_file META-INF/*

Example

After running the jar -u command, a JAR file named AddressBook.jar contains the following files. The files added in this task are in bold:

META-INF/MANIFEST.MF
META-INF/ejb-jar.xml
addr/Address.class
addr/AddressBook_RI.class
addr/AddressBookSoapBindingImpl.class
addr/AddressBookHome.class
addr/Phone.class
addr/StateType.class
addr/AddressBook.class
META-INF/wsdl/AddressBook.wsdl
META-INF/ibm-webservices-bnd.xmi
META-INF/webservices.xml
META-INF/AddressBook_mapping.xml

This topic explains how to assemble a Web services-enabled WAR file with command-line tools.

To assemble a Web services-enabled WAR file when starting from WSDL, follow these steps:

  1. Expand the WAR file into a directory.
  2. Confirm that the WEB-INF/web.xml deployment descriptor for the Web module contains a <servlet> element including the <servlet-name> element. The <servlet-name> element can be any string and the <servlet-class> element specifies the Java bean class that implements the service.
  3. Place the WSDL file as specified by the webservices.xml deployment descriptor <wsdl-file> element in the WEB-INF/wsdl subdirectory.
  4. Place the JAX-RPC mapping file as specified by the webservices.xml deployment descriptor <jaxrpc-mapping-file> element in the WEB-INF subdirectory.
  5. Place the webservices.xml and ibm-webservices-bnd.xmi deployment descriptors in the WEB-INF subdirectory.
  6. Run this command to add these files to the WAR file:
    jar -uvf WAR_file com WEB-INF/*