This topic explains how to use to assemble a Web archive (WAR)
file from a Web Services Description Language (WSDL) file that is enabled
for Web services.
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 to complete this task:
- An assembled WAR file that contains the Enterprise JavaBeans (EJB) implementation,
all the classes that generate from the WSDL2Java command-line tool
and the web.xml deployment descriptor file.
- A WSDL file
- The complete webservices.xml, ibm-webservices-bnd.xmi,
and ibm-webservices-ext.xmi deployment descriptors, and the Java
API for XML-based remote procedure call (JAX-RPC) mapping file.
About this task
Assemble a Web services-enabled WAR file from a WSDL file by following
the actions in the steps for this task section.
Procedure
- Start
an assembly tool. The Eclipse assembly tools 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.
- If
you have not done so already, configure the assembly tool for work
on J2EE modules. Ensure that J2EE and Web capabilities are
enabled.
- Click File > Import to import
the WAR file into the assembly tool.
- Open the J2EE perspective by clicking Windows >Open
Perspective > Other > J2EE.
- Switch to the Navigator pane by clicking the Navigator tab.
- Locate the project for the WAR file that you
just imported in the Navigator pane.
- Expand the WebContent directory so
that the WEB-INF directory is displayed. Expand the WEB-INF directory.
- Confirm that the WEB-INF/web.xml deployment
descriptor for the Web module contains a <servlet> element including the
<servlet-name> element:
- Double-click Web Deployment Descriptor. If
you are in the Navigator view, you need to double-click on the web.xml deployment
descriptor. If you are in the Project Explorer view, you can double-click
on Deployment Descriptor. Both of these ways open the Web Deployment Descriptor
Editor.
- In the Web Deployment Descriptor editor, click the Servlets tab.
- Enter the full path name of the Java bean class implementing
Web services in the Servlet class field.
- Close the editor window to save your change.
- Right-click 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 the wsdl directory and click Import > File
system. Browse the WSDL file for this Web service and click Finish.
- Copy the JAX-RPC mapping file as specified
by the deployment descriptor <jaxrpc-mapping-file> element of the webservices.xml file.
- Copy the webservices.xml, ibm-webservices-ext.xmi,
and the ibm-webservices-bnd.xmi deployment descriptors in the WEB-INF subdirectory.
Results
The artifacts required to enable the Web module for Web services is
added to the WAR file.