Skip Navigation Links | |
Exit Print View | |
Using SOAP Message Handlers Java CAPS Documentation |
Importing a JAX-RPC Handler Archive
To Import an Existing Message Handler Archive
Creating a JAX-RPC Handler Chain
To Create a New Chain of Message Handlers
Assigning Handler Chains to External Systems
To Assign the Handler Chain to a SOAP/HTTP Web Services External System
Implementing Custom SOAP Message Handlers
Creating a SOAP Message Handler Archive File
To Create the SOAP Message Handler Archive File
As defined in the JAX-RPC specification, message handlers provide a mechanism for adding, reading, and manipulating header blocks in SOAP messages that are sent and received by JAX-RPC clients and web service endpoints. By providing access to SOAP headers, you can import custom code to support SOAP standards that are not supported in basic versions of Java CAPS.
Although message handlers are Project-specific, they are added in Java CAPS Environments to allow easy reuse across multiple Projects. Multiple handlers can be installed or removed as needed, and they also may be chained, which allows staged execution of different types of processing modules.
Java CAPS version control is applied to all Environment sub-nodes and associated artifacts in the NetBeans IDE. You also may employ your own version control system for the handler code you import into Java CAPS.
Since SOAP message handlers have access to the entire SOAP message during request and response operations, there are many use cases for them. Examples of message handler uses include:
Authentication and authorization of the security tokens (typically packaged in the SOAP header)
Encryption and decryption
Logging and auditing
Caching
Gathering various metrics on transaction
JAX-RPC message handlers for use with Java CAPS are packaged in handler archives. A Handler archive consists of a ZIP file containing the following components:
One or more JAX-RPC handler implementation classes and any support classes
Any third-party JAR files on which the handler implementation depends (that are not available in the classpath in the application server runtime)
An XML descriptor file that describes the handlers packaged in the archive
The handler implementations might be dependent on the runtime configuration, so at design-time the handlers are configured in the Java CAPS Environment. This allows the reuse of the same message handler implementations across multiple projects in the same environment.
As defined in the JAX-RPC specification, the message handlers are ordered in a message handler chain and configured on the consumer or provider web service endpoints. This chained configuration enables the staged execution of custom SOAP message processing. When a web service request arrives at an endpoint, the handleRequest method for these handlers is called in the same order as they are ordered in the handler chain. When the response is sent back, the handleResponse method on these handlers is called in the reverse order as defined in he handler chain.
JAX-RPC message handlers are incorporated into Java CAPS Projects by means of a three-stage process:
Importing a handler archive, which can contain one or more individual handlers.
Creating one or more handler chains, each of which can contain one or more individual handlers in a specific order.
Associating the handler chains with specific SOAP/HTTP Web Service External Services.
The following topics provide instructions on how to proceed through this process.
Note - For more information about SOAP message handlers, along with sample projects, see the Java CAPS sample site at http://javacaps-samples.samplecode.oracle.com. Click the JAX-WS and JAX-RPC tab for more information.
Java CAPS provides pre-installed handler implementations in the Repository. These include a logging handler and a security handler that enables ws-security support.