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 JAR file that is enabled for Web services from an enterprise bean

This topic explains how to assemble a Web service-enabled enterprise bean Java archive (JAR) file with an assembly tool.

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

Assemble a Web services-enabled enterprise bean JAR file from Java code by following the actions in the steps for this task section.

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 JAR 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 containing the JAR file that you just imported in the Navigator pane.
  6. Expand the ejbModule entry until the META-INF directory display 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.
  8. 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.
  9. Copy the JAX-RPC mapping file, webservices.xml, ibm-webservices-bnd.xmi, and ibm-webservices-ext.xmi files into the META-INF directory.
  10. Import the service endpoint interface class so that the service endpoint interface package begins in the ejbModule directory. You can import either the source file or a compiled class file. If you import the source file it automatically compiles.

Results

You have the artifacts required to Web service-enable an Enterprise JavaBeans (EJB) module for Web services. The artifacts are added to the JAR file. Now you need to configure the deployment descriptors so that you can deploy the Web service into the WebSphere Application Server run time environment.

Example

The AddressBook.jar JAR file contains the following files after assembly. The files added in this task are in bold. These files include the WSDL file, the deployment descriptors, and the JAX-RPC mapping file.
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/ibm-webservices-ext.xmi
META-INF/webservices.xml
META-INF/AddressBook_mapping.xml

What to do next

Assemble the EAR file so that you can deploy the EAR file into WebSphere Application Server.



Related tasks
Assembling a Web services-enabled enterprise bean JAR file from a WSDL file
Assembling Web services applications
Assembling an enterprise bean JAR file into an EAR file
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_assembjarjava.html

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