Configure a WS-Transaction policy set by
We can configure the way that a JAX-WS client or web service handles Web Services Atomic Transaction (WS-AT) or Web Services Business Activity (WS-BA) context by configuring the Web Services Transaction (WS-Transaction) policy type. We can specify that the client or service must use context, can use context if it is available, or must not use context. Use command scripts to configure a policy set for web services transactions.
We can configure a WS-Transaction policy set by as described in this task, or we can configure a WS-Transaction policy set using the console.
WS-Transaction policy set support only exists at the application and service level. Although the console allows for the attachment of WS-Transaction policies/bindings at the endpoint and/or operation levels, they do not actually take affect.
- Start the wsadmin scripting client if it is not already running.
- Use the createPolicySet command to create a new policy set, or the copyPolicySet command to copy and rename an existing policy set. We can copy an existing user-defined policy set, or one of the WS-Transaction default policy sets (WSTransaction or SSL WSTransaction).
- Check that the policy set includes the WS-Transaction policy type. If necessary, add the WS-Transaction policy type. For example:
AdminTask.importPolicySet('[-defaultPolicySet WSTransaction]') AdminTask.addPolicyType('[-policySet policy_set_name -policyType WSTransaction -enabled true]')
- Use the setPolicyType command to configure the WS-Transaction policy type attributes. The WS-Transaction policy type has the following attributes:
- ATAssertion
- BAAtomicOutcomeAssertion
Each attribute can have the value supports, mandatory, or never. For detailed information about these configurable attributes, see the topic about WS-Transaction policy settings. For example:
AdminTask.setPolicyType('[-policySet policy_set_name -policyType WSTransaction -attributes "[ [BAAtomicOutcomeAssertion mandatory] [ATAssertion supports] ]"] -replace')
- Save the changes to the master configuration. For example, enter the following command:
AdminConfig.save()
What to do next
We are now ready to associate the policy set with the JAX-WS client, or with the JAX-WS web service, endpoint, or operation.
Related concepts
WSTransaction default policy sets
Related tasks
Configure a JAX-WS client for WS-Transaction context Configure a JAX-WS web service for WS-Transaction context Configure application and system policy sets for web services Create policy sets Start the wsadmin scripting client
WS-Transaction policy settings PolicySetManagement (AdminTask)