Web Services Addressing annotations

The WS-Addressing specification provides transport-neutral mechanisms to address Web services and to facilitate end-to-end addressing. If you have a JAX-WS 2.1 application you can use Java annotations in your code to specify WS-Addressing behavior at run time. Use WS-Addressing annotations to specify the actions that are associated with Web service operations, and also to enable or disable WS-Addressing support.

The following WS-Addressing annotations are supported in this product. These annotations are defined in the JAX-WS 2.1 specification unless otherwise stated.
javax.xml.ws.Action
Specifies the action that is associated with a Web service operation. When you use this annotation with a particular method, and generate the corresponding WSDL document, the WS-Addressing Action extension attribute is added to the input and output elements of the WSDL operation that corresponds to that method. For this attribute to be added to the WSDL operation you must also specify the Addressing annotation on the implementation class. If you do not want to use the Addressing annotation you can supply your own WSDL document with the Action attribute already defined.
javax.xml.ws.FaultAction
Specifies the action that is added to a fault response. When you use this annotation with a particular method, the WS-Addressing FaultAction extension attribute is added to the fault element of the WSDL operation that corresponds to that method. For this attribute to be added to the WSDL operation you must also specify the Addressing annotation on the implementation class. If you do not want to use the Addressing annotation you can supply your own WSDL document with the Action attribute already defined. This annotation must be contained within an Action annotation.
javax.xml.ws.soap.Addressing
Specifies that this service is to enable WS-Addressing support. You can use this annotation only on the service implementation bean; you cannot use it on the service endpoint interface.
com.ibm.websphere.wsaddressing.jaxws21.SubmissionAddressing
This annotation is part of the IBM implementation of the JAX-WS 2.1 specification. This annotation specifies that this service is to enable WS-Addressing support for the 2004/08 WS-Addressing specification. You can use this annotation only on the service implementation bean; you cannot use it on the service endpoint interface.
The following example code uses the Action annotation to define the invoke operation to be invoked (input), and the action that is added to the response message (output). The example also uses the FaultAction annotation to specify the action that is added to a response message if a fault occurs:
@WebService(name = "Calculator")
public interface Calculator {
   ...
  	 @Action(
      input="http://calculator.com/inputAction",
      output="http://calculator.com/outputAction",
      fault = { @FaultAction(className=AddNumbersException.class, 
                value="http://calculator.com/faultAction") 
      }
   )
   public int add(int value1, int value2) throws AddNumbersException {
      return value1 + value2;
   }
}
If you use a tool to generate service artefacts from code, the WSDL tags that are generated from the preceding example are as follows:
<definitions targetNamespace="http://example.com/numbers" ...>
   ...
   <portType name="AddPortType">
      <operation name="Add">
         <input message="tns:AddInput" name="Parameters"
                         wsaw:Action="http://calculator.com/inputAction"/>
         <output message="tns:AddOutput" name="Result"
           	               wsaw:Action="http://calculator.com/outputAction"/>
         <fault message="tns:AddNumbersException" name="AddNumbersException"
           	              wsaw:Action="http://calculator.com/faultAction"/>
      </operation>
    <portType>
    ...
<definitions>



Related concepts
Web Services Addressing support
Related tasks
Creating a JAX-WS Web service application that uses Web Services Addressing
Enabling Web Services Addressing support for JAX-RPC applications
Related reference
JAX-WS annotations
Concept topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 5:30:17 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-iseries&topic=cwbs_wsa_annots
File name: cwbs_wsa_annots.html