Assembling a Web services-enabled client WAR file into an EAR file
Overview
You need the following artifacts:
- Assembled client Web archive (WAR) module, containing the implementation, all classes generated by the WSDL2Java command-line tool, MANIFEST.MF and deployment descriptor.
- Web Services Description Language (WSDL) file used to develop the client
- Templates for webservicesclient.xml, ibm-webservicesclient-bnd.xmi and ibm-webservicesclient-ext.xmi deployment descriptors, if used.
- Generated JAX-RPC mapping deployment descriptor
Overview
You can use the Assembly Toolkit to assemble Web service-enabled client applications.
To assemble the client code and artifacts that enable the application client to access a Web service:
- Start the Assembly Toolkit.
- Click File > Import to import the WAR file into the Assembly Toolkit.
- Open the J2EE perspective by clicking Windows >Open Perspective > Other >J2EE.
- Switch to the Project Navigator pane by clicking the Project Navigator tab.
- Locate the project for the file you just imported in the Project Navigator pane.
- Expand the webContemt entry so the WEB-INF directory is displayed. Expand the WEB-INF directory.
- Right-click on the WEB-INF directory and select New > Folder. Create a subfolder named wsdl in the WEB-INF directory.
- Copy the WSDL file to the WEB-INF\wsdl directory by right-clicking on the wsdl directory and click File > Import > File system. Browse the WSDL file for this Web service and click Finish.
- Copy the webservicesclient.xml file and JAX-RPC mapping file in the WEB-INF subdirectory in the same manner you copied the WSDL file.The JAX-RPC mapping file is indicated by the <jaxrpc-mapping-file> element in the web.xml file.
- (Optional) Place the ibm-webservicesclient-ext.xmi and ibm-webservicesclient-bnd.xmi file in the WEB-INF subdirectory, if used.
- Assemble the WAR file into an EAR file using typical assembly techniques.
Results
The artifacts required to enable the client module to use Web services are added to the module.
Example
This example uses a WAR file named AddressBookWeb.war and an EAR file named AddressBook.ear:
WEB-INF/MANIFEST.MF WEB-INF/web.xml WEB-INF/wsdl/AddressBook.wsdl WEB-INF/webservicesclient.xml WEB-INF/AddressBook_mapping.xml WEB-INF/ibm-webservicesclient-ext.xmi (optional) WEB-INF/ibm-webservicesclient-bnd.xmi com/ibm/websphere/samples/webservices/addr/Address.class com/ibm/websphere/samples/webservices/addr/AddressBook.class com/ibm/websphere/samples/webservices/addr/AddressBookClient.class com/ibm/websphere/samples/webservices/addr/AddressBookService.class ...other generated classes...
After assembling the AddressBookWeb.war file into the AddressBook.ear file, the AddressBook.ear file contains the following files:
WEB-INF/MANIFEST.MF AddressBookWeb.war WEB-INF/application.xml
What to do next
Configure the webservicesclient.xml deployment descriptor .
Web services
Testing Web services-enabled clients
Configuring the ibm-webservicesclient-bnd.xmi deployment descriptor
Implementing Web services based on Web Services for J2EE
Developing Web services clients based on Web Services for J2EE
Artifacts used to develop Web services based on Web Services for J2EE