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.
@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>