Configuring a WS-Transaction policy set by using wsadmin scripting

You can configure the way that a Java™ API for XML Web Services (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. You 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.

About this task

You can configure a WS-Transaction policy set by using wsadmin scripting as described in this task, or you can configure a WS-Transaction policy set by using the administrative console.

Procedure

  1. Start the wsadmin scripting client if it is not already running.
  2. Use the createPolicySet command to create a new policy set, or the copyPolicySet command to copy and rename an existing policy set. You can copy an existing user-defined policy set, or one of the WS-Transaction default policy sets (WSTransaction or SSL WSTransaction).
  3. Check that your 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]')
    
  4. 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') 
  5. Save your changes to the master configuration. For example, enter the following command:
    AdminConfig.save()

What to do next

You are now ready to associate the policy set with the JAX-WS client, or with the JAX-WS Web service, endpoint, or operation.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 7:37:48 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=twbs_wstx_policy_config
File name: twbs_wstx_policy_config.html