Configuring Web Services Atomic Transaction

Web Services Atomic Transaction (WS-AT) is an OASIS standard. Now this feature is supported in Liberty.

About this task

Before you can configure Web Services Atomic Transaction (WS-AT) in Liberty, you must enable it. This task describes how to enable WS-AT feature in Liberty and also instructs you to add different configurations to WS-AT feature. In addition, you can use the UOWManager with type UOWSynchronizationRegistry.UOW_TYPE_LOCAL_TRANSACTION to run any code outside the scope of the current global transaction.

If you do not add the WS-AT feature in Liberty but have any of the following information in your application, an exception message is displayed. The message indicates that the WS-AT feature is not installed in the Liberty log:
  • WS-Transaction policy information in WSDL
  • Web Services Atomic Transaction Coordination context information in Web Services Soap Header

To enable and configure the WS-AT feature in Liberty, perform the following steps:

Procedure

  1. To enable the WS-AT feature in Liberty, add the following entry inside the featureManager element in the server.xml file:
    <feature>wsAtomicTransaction-1.2</feature>
  2. Optional: Add some special configurations for the WS-AT feature.
    You can configure SSL or proxy endpoint for WS-AT internal 2PC protocol communication as follows:
    <wsAtomicTransaction SSLEnabled="false" SSLRef="defaultSSLConfig" externalURLPrefix="" clientAuth="false"/> 

For more information, see Configuring SSL or proxy endpoint parameters in the server.xml file.

  1. Optional: To run transactions outside the scope of the current global transaction, add the following code to the client side:
    
    UOWManager uowManager = (UOWManager) ctx
        .lookup("java:comp/websphere/UOWManager");
    uowManager
        .runUnderUOW(
            UOWSynchronizationRegistry.UOW_TYPE_LOCAL_TRANSACTION,
    	 false, new UOWAction() {
              public void run() throws Exception {
    	     ...
    	     // Example code
    	     callService1(service1, wsTransactionEnd1);
    	     ...
    	   } 
    	  });