Enabling Web Services Addressing support for JAX-WS applications using addressing features
For JAX-WS applications, you can enable WS-Addressing support during development of a client application, by using addressing features in the code.
About this task
- AddressingFeature - use this class if you want to send messages that include WS-Addressing headers that conform to the 2005/08 WS-Addressing specification
- SubmissionAddressingFeature - use this class if you want to send messages that include WS-Addressing headers that conform to the 2004/08 WS-Addressing specification
Parameter name | Possible values | Description |
---|---|---|
enabled | true (default) |
Whether WS-Addressing support is enabled. |
required | true |
Whether WS-Addressing headers are required. |
responses | Responses.All (default) |
Whether to use a synchronous or an asynchronous
message exchange pattern. Specify Responses.ANONYMOUS to send messages
in a synchronous message pattern; use Responses.NON_ANONYMOUS to send
messages in an asynchronous message exchange pattern. Note: This parameter
is not supported for the SubmissionAddressingFeature class.
|
Procedure
AddressingFeature feat = new AddressingFeature(true, true, AddressingFeature.Responses.NON_ANONYMOUS);
To
specify that WS-Addressing is disabled for the 2004/08 specification,
use the following code: SubmissionAddressingFeature feat = new SubmissionAddressingFeature(false);
Results
If you specify that WS-Addressing is enabled, the client includes WS-Addressing headers in SOAP messages. The headers conform to the WS-Addressing specification indicated by the type of feature class used. If the server does not use annotations, or uses policy sets to enable WS-Addressing, the server accepts both the 2005/08 and 2004/08 specifications.
If you specify that WS-Addressing is required and the client receives a message that does not include WS-Addressing headers, the client returns a fault.
If you specify the responses attribute, the corresponding message exchange pattern will be used.