uCosminexus Application Server, Web Service Development Guide
To set the handler chain in the Web Service, annotate the SEI, Web Service Implementation Class, or the Provider Implementation Class using the javax.jws.HandlerChain annotation and specify the handler chain setup file using the file element of the javax.jws.HandlerChain annotation.
The following is an example of annotating the Web Service Implementation Class using the javax.jws.HandlerChain annotation:
package com.sample;
@javax.jws.WebService
@javax.jws.HandlerChain(file="handlers.xml")
public class AddNumbersImpl{
public int add( int number1, int number2 ) throws AddNumbersFault{
...
}
}
|
In this example, the handler chain defined in the handler chain setup file handlers.xml is linked with the Web Service Implementation Class com.sample.AddNumbersImpl.
A handler chain setup file is required for each Web Service. A handler chain setup file might also be shared by multiple Web Services, but in that case, the same settings are applied.
For details about the javax.jws.HandlerChain annotation, see the subsection 16.2.3 javax.jws.HandlerChain annotation.
The handler chain setup file defines the handler chain configuration when the handler is used to add processing for the Web Service. The file is specified using the file element of the javax.jws.HandlerChain annotation.
For details about the support range of the handler chain setup file, see the subsection 19.4 Support range of the handler chain setup file. This point describes the syntax and deployment of the handler chain setup file.
Code the syntax of the handler chain setup file in the range supported by the standard schema of Java EE 5 specifications (Java EE Web Services Metadata Handler Chain Schema) and the Cosminexus JAX-WS functionality.
You can reference the standard schema by accessing the namespace URI of Java EE 5 (http://java.sun.com/xml/ns/javaee/). The following is an example of coding of the handler chain setup file:
<?xml version="1.0" encoding="UTF-8"?> <handler-chains xmlns="http://java.sun.com/xml/ns/javaee"> <handler-chain> <handler> <handler-class>org.test.handler.LoggingHandler</handler-class> </handler> </handler-chain> </handler-chains> |
Store the handler chain setup file at the following locations:
The deployment of the file complies with the file system limitations for the OS and Java EE 5 specifications, and if the file can be stored in the WAR file or EJB JAR file, there are no limitations on the file name, the directory name below the WEB-INF directory, EJB JAR directory name, and the path length.
If the SOAP role and actor settings are omitted or if null is specified, the default value is specified. The default value is http://schemas.xmlsoap.org/soap/actor/next for a SOAP Messages in the SOAP 1.1 specification and http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver for the SOAP Messages in the SOAP 1.2 specification.
Set up 0, 1, true, or false in the soap:mustUnderstand attribute. If another value is specified, 0 or false is assumed.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.