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:
- Place the JAR file in the root directory.
- Place the WSDL file specified by the deployment descriptor <wsdl-file> element in the META-INF/wsdl subdirectory.
- Place the JAX-RPC mapping file as specified by the deployment descriptor <jaxrpc-mapping-file> element in the META-INF subdirectory.
- Place the webservices.xml and ibm-webservices-bnd.xmi files in the META-INF subdirectory.
- (Optional) If you developed a service endpoint interface class, place it in a subdirectory corresponding to its Java package.
- 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.xmlThis 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:
- Expand the WAR file into a directory.
- 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.
- Place the WSDL file as specified by the deployment descriptor <wsdl-file> element of webservices.xml file in the WEB-INF/wsdl subdirectory.
- Place the JAX-RPC mapping file as specified by the deployment descriptor <jaxrpc-mapping-file> element of webservices.xml in the WEB-INF subdirectory.
- Place the webservices.xml and ibm-webservices-bnd.xmi deployment descriptors in the WEB-INF subdirectory.
- (Optional) If you developed a service endpoint interface class, place it in a subdirectory corresponding to its Java package.
- Run this command to add these files to the WAR file:
jar -uvf WAR_file com WEB-INF/*