Assemble a J2EE Web service based on an existing application

This topic explains how to use the command-line tools to assemble a Web service-enabled enterprise bean JAR file.

To assemble an Web services-enabled enterprise bean JAR file when starting from Java code, follow these steps:

  1. Place the JAR file in the root directory.
  2. Place the WSDL file 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. (Optional) If you developed a service endpoint interface class, place it in a subdirectory corresponding to its Java package.
  6. Run this command to add these files to the enterprise bean JAR file:
    jar -uvf JAR_file com META-INF/*

Example

After running the jar -u command on a JAR file named AddressBook.jar, the JAR file 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/AddressBookBean.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 use the command-line tools to assemble a Web service-enabled WAR file.

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

  1. Expand the WAR file into a directory.
  2. Confirm that the WEB-INF/web.xml descriptor for the Web module contains a <servlet-class> element indicating the Java bean class that implements the service.
  3. Place the WSDL file as specified by the deployment descriptor <wsdl-file> element of webservices.xml file in the WEB-INF/wsdl subdirectory.
  4. Place the JAX-RPC mapping file as specified by the deployment descriptor <jaxrpc-mapping-file> element of webservices.xml in the WEB-INF subdirectory.
  5. Place the webservices.xml and ibm-webservices-bnd.xmi deployment descriptors in the WEB-INF subdirectory.
  6. (Optional) If you developed a service endpoint interface class, place it in a subdirectory corresponding to its Java package.
  7. Run this command to add these files to the WAR file:
    jar -uvf WAR_file com WEB-INF/*