The handlers.xml Configuration File
The handlers configuration file specifies several parts of the service, including the name of service and the various chains. You may add additional handlers at any point in the flow without changing the generated code, or having to regenerate code.
A sample handlers configuration file is generated for each service and contains one required element, the service, which defines the handler chains. Multiple chains can be configured, and each chain is processed in the order in which it appears.
Here is an example of the <servicecontextname>_handlers.xml file.
<service name="FaultService"> <!-- 1 -->
<request-handlers> <!-- 2 -->
<handler name="http://localhost:8080/fault/FaultSkeleton">
<property name="SomeParameter" value="Some value"/>
<transport-handlers/> <!-- 3 -->
<service-endpoint name="http://localhost:8080/fault/Fault"/> <!-- 4 -->
<response-handlers/> <!-- 5 -->
<fault-handlers/> <!-- 6 -->
//1 The service element contains all the chains for this service. Its name attribute defines the service’s name. Note that this name is an initialization parameter in web.xml so when the servlet has a message to dispatch, it knows to send it to this FaultService for processing.
//2 The request-handlers perform any special processing to the request as it arrives, and then pass the request to the skeleton. To add special request-handlers, insert them before the skeleton, which is the only required request-handler.
Extra configuration information can be passed to the handlers by using the property elements. Each handler can have a set of property elements that are automatically passed to the handler when the handler is constructed. These properties are defined in servicecontextname_handlers.xml.
//3 The transport-handlers element contains any special handlers on the transport, such as encryption or compression handlers.
//4 The service-endpoint element points to the service implementation.
//5 The response-handlers element would include any special handlers for sending the response back to the client. In this case, the element is empty, so this chain is ignored.
//6 The fault-handlers element includes specific fault handlers.