This sample demonstrates how JAX-WS handlers are used in the WSO2 Application Server. The server uses a SOAP protocol handler, which logs incoming and outgoing messages to the console. The server code registers a handler using the @HandlerChain annotation within the service implementation class. In this sample, LoggingHandler is the SOAPHandler that logs the entire SOAP message content to stdout.
The client includes a logical handler that checks the parameters on outbound requests and short-circuits the invocation in certain circumstances. This handler is specified programmatically.
Building and running the sample
This sample can be found at <AS_HOME>\samples\Jaxws-Jaxrs\handlers_jaxws
For information on building and running the sample, see Building and Running JAX-WS Samples.
When specifying the handler file path in the @HandlerChain
annotation, the complete path from root should be given as:
@HandlerChain(file = "/demo/handlers/common/demo_handlers.xml")
Relative paths such as "../common/demo_handlers.xml
" do not render in WSO2 Carbon. The full package hierarchy should be used.