Assembling a Web services-enabled client JAR file into an EAR file
You need the following artifacts...
- Assembled client module, containing the implementation, all classes generated by the WSDL2Java command-line tool, MANIFEST.MF and deployment descriptor. This module can be...
- An application client module containing META-INF/application-client.xml
- An enterprise JavaBean (EJB) module containing META-INF/ejb-jar.xml
- Web Services Description Language (WSDL) file used to develop the client
- Templates for webservicesclient.xml and ibm-webservicesclient-ext.xmi deployment descriptors, if used.
- Generated JAX-RPC mapping deployment descriptor
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 EJB JAR file, App Client JAR file, or 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 ejbModule (for an EJB JAR file) or the appClientModule (for the application client JAR file) entry so the META-INF directory is displayed. Expand the META-INF directory.
- Right-click the META-INF directory and select New > Folder. Create a subfolder named wsdl in the META-INF directory.
- Copy the WSDL file to the META-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 and the JAX-RPC mapping file in the META-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 webservicesclient.xml file.
- (Optional) Place the ibm-webservicesclient-ext.xmi and the ibm-webservicesclient-bnd.xmi file in the META-INF subdirectory, if used.
- Assemble the JAR file into an EAR file using typical assembly techniques if the client runs in a container.
- 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 and the 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 webservicesclient.xml file.
- (Optional) Place the ibm-webservicesclient-ext.xmi and ibm-webservicesclient-bnd.xmi file in the WEB-INF subdirectory, if used.
The artifacts required to enable the client module to use Web services are added to the module.
Usage Scenario
This example uses a JAR file named AddressBookClient.jar and an EAR file named AddressBookClient.ear
META-INF/MANIFEST.MF META-INF/application-client.xml META-INF/wsdl/AddressBook.wsdl META-INF/webservicesclient.xml META-INF/AddressBook_mapping.xml com/i../WAS51/samples/webservices/addr/Address.class com/i../WAS51/samples/webservices/addr/AddressBook.class com/i../WAS51/samples/webservices/addr/AddressBookClient.class com/i../WAS51/samples/webservices/addr/AddressBookService.class ...other generated classes...After assembling the AddressBookClient.jar file into the AddressBookClient.ear file, the AddressBookClient.ear file contains the following files
META-INF/MANIFEST.MF AddressBookClient.jar META-INF/application.xmlConfigure the webservicesclient.xml deployment descriptor .
See Also
Web services
Testing Web services-enabled clients
Configuring the ibm-webservicesclient-bnd.xmi deployment descriptor
Using 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