6 Using Web Services Atomic Transactions

This section describes how to use Web services atomic transactions to enable interoperability with other external transaction processing systems. This section applies to SOA Web services and references only.

Overview of Web Services Atomic Transactions

WebLogic Web services enable interoperability with other external transaction processing systems, such as Websphere, JBoss, Microsoft .NET, and so on, through the support of the following specifications:

These specifications define an extensible framework for coordinating distributed activities among a set of participants. The coordinator, shown in the following figure, is the central component, managing the transactional state (coordination context) and enabling Web services and clients to register as participants.

Figure 6-1 Web Services Atomic Transactions Framework

Description of Figure 6-1 follows
Description of "Figure 6-1 Web Services Atomic Transactions Framework"

The following table describes the components of Web services atomic transactions, shown in the previous figure.

Table 6-1 Components of Web Services Atomic Transactions

Component Description

Coordinator

Manages the transactional state (coordination context) and enables Web services and clients to register as participants.

Activation Service

Enables the application to activate a transaction and create a coordination context for an activity. Once created, the coordination context is passed with the transaction flow.

Registration Service

Enables an application to register as a participant.

Application Protocol X, Y

Supported coordination protocols, such as WS-AtomicTransaction.


The following figure shows two instances of WebLogic Server interacting within the context of a Web services atomic transaction. For simplicity, two WebLogic Web service applications are shown.

Figure 6-2 Web Services Atomic Transactions in WebLogic Server Environment

Description of Figure 6-2 follows
Description of "Figure 6-2 Web Services Atomic Transactions in WebLogic Server Environment"

Please note the following:

  • Using the local JTA transaction manager, a transaction can be imported to or exported from the local JTA environment as a subordinate transaction, all within the context of a Web service request.

  • Creation and management of the coordination context is handled by the local JTA transaction manager.

  • All transaction integrity management and recovery processing is done by the local JTA transaction manager.

For more information about JTA, see Programming JTA for Oracle WebLogic Server.

The following describes a sample end-to-end Web services atomic transaction interaction, illustrated in Figure 6-2:

  1. Application A begins a transaction on the current thread of control using the JTA transaction manager on Server A.

  2. Application A calls a Web service method in Application B on Server B.

  3. Server A updates its transaction information and creates a SOAP header that contains the coordination context, and identifies the transaction and local coordinator.

  4. Server B receives the request for Application B, detects that the header contains a transaction coordination context and determines whether it has already registered as a participant in this transaction. If it has, that transaction is resumed and if not, a new transaction is started.

    Application B executes within the context of the imported transaction. All transactional resources with which the application interacts are enlisted with this imported transaction.

  5. Server B enlists itself as a participant in the WS-AT transaction by registering with the registration service indicated in the transaction coordination context.

  6. Server A resumes the transaction.

  7. Application A resumes processing and commits the transaction.

Enabling Web Services Atomic Transactions on an Oracle SOA Suite Web Service (Inbound)

On an Oracle SOA Suite Web service, you enable and configure Web services atomic transactions at design time using Oracle JDeveloper when creating a Web service, or at deployment time using the Oracle Enterprise Manager. For more information, refer to the following sections:

For information about configuration options, see Configuring Web Services Atomic Transactions.

Enabling Web Services Atomic Transactions on an Oracle SOA Suite Reference (Outbound)

On an Oracle SOA Suite reference, you enable and configure Web services atomic transactions at deployment time using the Oracle Enterprise Manager. You configure the version and flow type, as defined in Table 6-3. For more information, see "Configuring Web Services Atomic Transactions" in Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

You enable and configure Web services atomic transactions at design time using Oracle JDeveloper when creating a Web service, or at deployment time using the Oracle Enterprise Manager. For more information, refer to the following sections:

For information about configuration options, see Configuring Web Services Atomic Transactions.

Configuring Web Services Atomic Transactions

The following tables summarizes the configuration options that you can set when enabling Web services atomic transactions on a SOA Web service. For information about enabling Web service atomic transactions, see Enabling Web Services Atomic Transactions on an Oracle SOA Suite Web Service (Inbound) and Enabling Web Services Atomic Transactions on an Oracle SOA Suite Reference (Outbound).

Table 6-2 Web Services Atomic Transactions Configuration Options

Attribute Description

Version

Version of the Web services atomic transaction coordination context that is supported for the SOA service or reference. For SOA references, it specifies the version used for outbound messages only. The value specified must be consistent across the entire transaction.

Valid values include WSAT10, WSAT11, WSAT12, and DEFAULT.

The DEFAULT value for SOA services is all three versions (driven by the inbound request).

The DEFAULT value for SOA references is as follows:

  • If the flow option is WSDLDRIVEN, then the version advertised in the WSDL is used.

  • If the flow option is any setting other than WSDLDRIVEN, then WSAT10 is used.

Flow type

Whether the Web services atomic transaction coordination context is passed with the transaction flow. For valid values, see Table 6-3.


The following table summarizes the valid values for flow type and their meaning on the Web service and client. The table also summarizes the valid value combinations when configuring web services atomic transactions for an EJB-style web service that uses the @TransacationAttribute annotation.

Table 6-3 Flow Ttransaction coordination contextypes Values

Value Web Service Client Web Service Valid EJB @TransactionAttribute Values

NEVER (Default for SOA service)

JTA transaction: Do not export transaction coordination context.

No JTA transaction: Do not export transaction coordination context.

Transaction flow exists: Do not import transaction coordination context. If the CoordinationContext header contains mustunderstand="true", a SOAP fault is thrown.

No transaction flow: Do not import transaction coordination context.

NEVER, NOT_SUPPORTED, REQUIRED, REQUIRES_NEW, SUPPORTS

SUPPORTS

JTA transaction: Export transaction coordination context.

No JTA transaction: Do not export transaction coordination context.

Transaction flow exists: Import transaction context.

No transaction flow: Do not import transaction coordination context.

SUPPORTS, REQUIRED

MANDATORY

JTA transaction: Export transaction coordination context.

No JTA transaction: An exception is thrown.

Transaction flow exists: Import transaction context.

No transaction flow: Service-side exception is thrown.

MANDATORY, REQUIRED, SUPPORTS

WSDLDRIVEN (SOA references only, and the default)

Behaves according to the value that is advertised in the Web service WSDL.

N/A

Depends on advertised value.


Securing the Messages Exchanged Between the Coordinator and Participant

To secure messages exchanged between the coordinator and participant, you can configure the properties defined in the following table using the WebLogic Server Administration Console. These properties are configured at the domain level. For detailed steps, see "Configure Web services atomic transactions" in the Oracle WebLogic Server Administration Console Help.

Table 6-4 Securing Web Services Atomic Transactions

Property Description

Web Services Transactions Transport Security Mode

Specifies whether two-way SSL is used for the message exchange between the coordinator and participant. This property can be set to one of the following values:

  • SSL Not Required—All Web service transaction protocol messages are exchanged over the HTTP channel.

  • SSL Required—All Web service transaction protocol messages are exchanged over the HTTPS channel. This flag must be enabled when invoking Microsoft .NET Web services that have atomic transactions enabled.

  • Client Certificate Required—All Web service transaction protocol messages are exchanged over HTTPS and a client certificate is required.

For more information, see "Configure two-way SSL" in the Oracle WebLogic Server Administration Console Help.

Web Service Transactions Issued Token Enabled

Flag the specifies whether to use IssuedToken to enable authentication between the Web services atomic transaction coordinator and participant.

The IssuedToken is issued by the coordinator and consists of a security context token (SCT) and a session key used for signing. The participant sends the signature, signed using the shared session key, in its registration message. The coordinator authenticates the participant by verifying the signature using the session key.