You can 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 need
the following artifacts that are generated by the
WSDL2Java command-line
tool 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
- 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.