WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Assembling a Web services-enabled client JAR file into an EAR file

Now that you have generated deployment descriptors, located the Web Services Description Language (WSDL) file that was used to develop the Web services client, and generated the necessary classes for the client module, you need to assemble these artifacts to create an enterprise archive (EAR) file that is used in the Web services application.

Before you begin

You can assemble Java-based Web services modules with assembly tools provided with WebSphere Application Server.

You must configure the assembly tool before you can use it.

You need the following artifacts that are generated from the WSDL2Java command-line tool to complete this task:

About this task

You can use assembly tools included with WebSphere Application Server to assemble Web services-enabled client applications.

Assemble the client code and artifacts that enable the application client to access a Web service with steps provided:

Procedure

  1. Start an assembly tool. The Eclipse assembly tools, Application Server Toolkit (AST) and Rational Web Developer provide a graphical interface for developing code artifacts, assembling the code artifacts into various archives or modules and configuring related J2EE Version 1.2, 1.3 or 1.4 compliant deployment descriptors.
  2. Click File > Import to import the enterprise bean Java archive (JAR) file, AppClient JAR file, or the web archive (WAR) file into the assembly tool.
  3. Open the J2EE perspective by clicking Windows >Open Perspective > Other >J2EE.
  4. Switch to the Navigator pane by clicking the Navigator tab.
  5. Locate the project for the file that you just imported in the Navigator pane.
  6. Expand the ejbModule for an enterprise bean JAR file or the appClientModule for the application client JAR file entry so that the META-INF directory is displayed. Expand the META-INF directory.
  7. Right-click the META-INF directory and click New > Folder. Create a subfolder named wsdl, in the META-INF directory.
    1. Copy the WSDL file to the META-INF\wsdl directory by right-clicking the wsdl directory and click Import > File system. Browse the WSDL file for this Web service and click Finish.
    2. Copy theejb-jar.xml deployment descriptor or the application-client.xml deployment descriptor. If the deployment descriptor file already exists in the JAR file, manually merge the <service-ref> elements in the existing ejb-jar.xml file or the application-client.xml file with the original ejb-jar.xml file or the application-client.xml file that you generated with the WSDL2Java tool.
    3. (Optional) Place the ibm-webservicesclient-ext.xmi file and the ibm-webservicesclient-bnd.xmi file in the META-INF subdirectory, if used.
  8. Assemble the JAR file into an enterprise archive (EAR) file using typical assembly techniques if the client runs in a container.
  9. Right-click the META-INF directory and click New > Folder. Create a subfolder named wsdl in the META-INF directory.
    1. Copy the WSDL file to the META-INF\wsdl directory by right-clicking on the wsdl directory and click Import > File system. Browse the WSDL file for this Web service and click Finish.
    2. Copy the JAX-RPC mapping file in the META-INF subdirectory in the same manner that you copied the WSDL file. The JAX-RPC mapping file is indicated by the element in the ejb-jar.xml file or the application-client.xml file.
    3. (Optional) Place the ibm-webservicesclient-ext.xmi file and the ibm-webservicesclient-bnd.xmi file in the META-INF subdirectory, if used. If these files are already in the module, manually merge the contents of the files that are generated by the WSDL2Java tool into the existing files.

Results

You have the artifacts required to enable the client module to use Web services are added to the module.

Example

This example of the assembly process uses the AddressBookClient.jar JAR file the AddressBookClient.ear EAR file:
META-INF/MANIFEST.MF
META-INF/application-client.xml
META-INF/wsdl/AddressBook.wsdl
META-INF/AddressBook_mapping.xml

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 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.xml

What to do next

Now that you have assembled the client module, you need to configure the bindings so that the client can communicate with a Web service that is deployed on a server.



Related concepts
Web services
Related tasks
Testing Web services-enabled clients
Task overview: Implementing Web services applications
Developing and deploying Web services clients
Related reference
Artifacts used to develop Web services
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/twbs_assembclient.html

© Copyright IBM Corporation 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)