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:
- Place the JAR file in the root directory.
- Place the WSDL file as 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.
- 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.xmlThis 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:
- Expand the WAR file into a directory.
- 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.
- Place the WSDL file as specified by the webservices.xml deployment descriptor <wsdl-file> element in the WEB-INF/wsdl subdirectory.
- Place the JAX-RPC mapping file as specified by the webservices.xml deployment descriptor <jaxrpc-mapping-file> element in the WEB-INF subdirectory.
- Place the webservices.xml and ibm-webservices-bnd.xmi deployment descriptors in the WEB-INF subdirectory.
- Run this command to add these files to the WAR file:
jar -uvf WAR_file com WEB-INF/*