Configure the webservices.xml deployment descriptor for handler classes
This topic explains how to use and assembly tool to configure the webservices.xml deployment descriptor for user-provided handler classes.
Before you begin
One can configure deployment descriptors with assembly tools provided with WebSphere Application Server.
You must configure the assembly tool before use it.
A handler class is a class that is written to modify a SOAP message that represents a remote procedure call (RPC) request or response. Handlers can be associated with a Web service or a Web service client.
To complete this task, we need an EAR file for the applications that you want to configure. For some handler use, such as logging or tracing, only the server or client application require configuration. For other handler use, including sending information in the SOAP headers, the client and server applications must be configured with symmetrical handlers.
The modules in the EAR file contain the handler classes to configure. These classes implement the javax.xml.rpc.handler.Handler interface. For more information on writing handler classes, see Chapter 6 of the Web Services for J2EE specification and Chapter 12 of the JAX-RPC specification available through Web services: Resources for learning. The application modules must contain the webservices.xml deployment descriptor.
Overview
Configure a handler in the webservices.xml deployment descriptor by following the listed steps:
Procedure
- 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 (modules) and configuring related J2EE V1.2, 1.3 or 1.4 compliant deployment descriptors.
- Click File > Import and import the EAR file into the assembly tool.
- Open the J2EE perspective by clicking Windows >Open Perspective > Other >J2EE.
- Click the Navigator tab to switch to the Navigator pane.
- Locate the project that contains the webservices.xml deployment descriptor. Expand the directories under the project until the META-INF or the WEB-INF directory and its contents, including the webservices.xml file, are visible.
- Right-click the webservices.xml file.
- Click Open. The Web Services editor opens.
- Expand the Web services descriptions section and select the service for which you want to configure the handler.
- Click the Port components tab at the bottom of the editor window and select a port_component for which you want the editor to open.
- Expand the Port component handlers section.
- Click Add at the bottom of the Handlers section. A Class browser opens.
- Browse for the name of the handler class in the module. Select the class in the Matching types field and click OK. The Class browser window closes and the Handlers pane of the Web Services Editor opens.
- (Optional) Configure properties in the Handlers pane. See Handler class properties for a list of the properties that one can configure.
- Type ctrl-s to save the changes.
Related Tasks
Configuring the client deployment descriptor for handler classes with an assembly tool
See Also
Handler class properties
Example: Configuring handler classes for Web services deployment descriptors