Chapter 4: Web Services Administration
A handler is a Java class that implements org.apache.axis.Handler. They are contained in a Handlers folder for each Web service. You can have multiple handlers for each Web service. A handler class can be deployed to the server in the following ways:
If deploying a service from the WST development tool, include the handler class file in the current Web services project. When the service is deployed to the server, the handler class is also deployed.
If the handler class is contained in a JAR file, manually copy the JAR to the java/classes subdirectory of your EAServer installation, and add the JAR file to the server’s classpath. This may be a more efficient method if the handler is to be used by more than one Web service.
You can define two types of handlers:
Request handlers – are invoked before the actual Web service method is invoked. For example, you may have a handler that implements customized authentication logic, depending on the request.
Response handlers – is invoked after the actual Web service method is invoked. For example, you may have a handler that sends the contents of a SOAP message after the method is invoked.
Handlers can not be created, edited, or moved using the WST development tool, only added and deleted.
A handler definition can be added to a Web service provided the handler class has already been deployed or installed in the server, as described above.The WST development tool and the Web console have menu options to add a handler from the Handlers folder, and set necessary properties for the handler. A request and response handler contains these properties:
A name by which the handler is identified
The Java class that implements the handler
Any parameters that the handler requires
Some examples of built-in handlers include:
Refer to the Java documentation of these handlers for more information. Java documentation can be accessed from the EAServer contents screen where host_name is the name of the your EAServer host. localhost is the default.
|Copyright © 2005. Sybase Inc. All rights reserved.|