Configure the WS-Transaction policy
When we work with policy sets in the administrative console, we can configure the WS-Transaction policy type for the WS-AtomicTransaction (WS-AT) and the WS-BusinessActivity (WS-BA) protocols. We can configure whether a client propagates, and a server receives, a WS-AT context, and whether a client propagates, and a server receives, a WS-BA context.
We must be working with a policy set that includes the WS-Transaction policy type.
Do not edit the policies associated with the provided default policy sets. To modify the WS-Transaction policy settings, use a copy of a default policy set or create a new policy set.
We can configure the policies for the WS-AtomicTransaction and WS-BusinessActivity protocols. The WS-AT protocol supports coordination of activities so that either all the activities occur, or none of them occur. The WS-BA protocol supports coordination of activities that are more loosely coupled than atomic transactions and that therefore require a compensation process if a failure occurs in the business activity.
When we add a WS-Transaction policy, it is equivalent to setting the following deployment descriptors associated with an EJB or web module:
- Use Web Services Atomic Transaction
- Send Web Services Atomic Transaction on requests
- Execute using Web Services Atomic Transaction on incoming requests
A WS-BA context is sent if the client is running in a BusinessActivity scope (BAScope). A provider runs in a BAScope if it receives a message containing a WS-BA context, as long as the provider is set to run EJB methods in a Business Activity scope.
Tasks
- In the navigation pane of the administrative console, click Services > Policy sets > Application policy sets > policy_set_name > [Policies] WS-Transaction. The WS-Transactions settings pane is displayed.
- In the WS-AtomicTransaction section, select the option you require:
- Mandatory. For a client, the client always propagates a WS-AT context on an outbound request. For a server, any request that is received must include a WS-AT context, otherwise the request is rejected.
- Supports. For a client, the client can propagate a WS-AT context on an outbound request when that context is available. For a server, if a request includes a WS-AT context, the context is imported and established on the thread before the request is processed.
- Never. For a client, the client never propagates a WS-AT context on an outbound request. For a server, any request that is received must not include a WS-AT context, otherwise the request is rejected.
- In the WS-BusinessActivity section, select the option you require:
- Mandatory. For a client, the client always propagates a WS-BA context on an outbound request. For a server, any request that is received must include a WS-BA context, otherwise the request is rejected.
- Supports. For a client, the client can propagate a WS-BA context on an outbound request when that context is available. For a server, if a request includes a WS-BA context, the context is imported and established on the thread before the request is processed.
- Never. For a client, the client never propagates a WS-BA context on an outbound request. For a server, any request that is received must not include a WS-BA context, otherwise the request is rejected.
- Click OK.
- Save changes to the master configuration.
After configuring the WS-Transaction policy, the associated policy set uses this policy to support WS-AtomicTransaction and WS-BusinessActivity.
Subtopics
- WS-Transaction policy settings
Specify the policies for the WS-AtomicTransaction (WS-AT) and WS-BusinessActivity (WS-BA) protocols. WS-AT supports coordination of activities so that either all the activities occur, or none of them occur. WS-BA supports coordination of activities that are more loosely coupled than atomic transactions, and that therefore, require a compensation process if an error occurs.
Related:
Web services policies Web Services Atomic Transaction support in the application server Web Services Business Activity support in the application server Configure a JAX-WS client for WS-Transaction context Configure a JAX-WS web service for WS-Transaction context Configure a WS-Transaction policy set by Manage policies in a policy set Configure application and system policy sets for web services Configure transactional deployment attributes Create an application that uses the Web Services Business Activity support