Assembling a Web services-enabled WAR file from a WSDL file
This topic explains how to use to assemble a WAR file from a Web Services Description Language (WSDL) file that is enabled for Web services.
Before you begin
We can assemble Web Services for J2EE modules with assembly tools provided with WebSphere Application Server.
You must configure the assembly tool before use it. You need the following artifacts to complete this task:
- An assembled WAR file that contains the EJB implementation, all the classes that generate from the WSDL2Java command 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.
Overview
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 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 (modules) and configuring related J2EE V1.2, 1.3 or 1.4 compliant deployment descriptors.
- 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, we need to double-click on the web.xml deployment descriptor. If you are in the Project Explorer view, one 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.
Result
The artifacts required to enable the Web module for Web services is added to the WAR file.
What to do next
Now one can assemble the WAR file that is enabled for Web services into an EAR file.
Related Tasks
Assembling a Web services-enabled WAR into an EAR file
Assembling a WAR file that is enabled for Web services from Java code