NonStop SOAP User's Manual

NonStop SOAP Features and Functions
NonStop SOAP User’s Manual520501-012
4-16
Starting a Transaction
A SOAP server does not begin, abort, or end a transaction implicitly (without the
knowledge of the SOAP client), except in these cases:
When a context-sensitive server ends a dialog, and the service permits only one
transaction per dialog. In this case, the SOAP server ends the transaction but not
the session.
When the target server (context free or context sensitive) aborts a transaction after
a system error, the SOAP server implicitly ends the session and aborts any
transaction associated with the session.
When the SOAP server ends a session under a client request which does not
specify CurrentTransactionCommand, it implicitly commits the current transaction
within that session.
When the SOAP server end a session which has expired, it implicitly aborts the
current transaction within that session.
Starting a Transaction
To start a transaction, the client sends a SOAP message specifying “yes” as the value
of the BeginNewTransaction attribute of the Session element of the NonStop SOAP
header. (For the header DTD, see NonStop SOAP Header on page 4-2.)
A message that begins a transaction must either request a new session or include the
session ID of an existing session. The SOAP server stores the transaction tag as part
of the session context. The server returns a fault if it cannot begin a transaction--for
example, if the target service does not support transactions--or if a transaction is
already in progress for the session.
The body of a request that starts a transaction can invoke a target service, or it can be
empty, as in this example:
Continuing a Transaction
A transaction continues automatically if a request specifies a session ID for which a
transaction is in progress and the target service supports transactions.
For an example, see Request Continues the Session and the Transaction on
page 6-40.
Example 4-14. Starting a Transaction
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:sd="urn:compaq_nsk_oss_SoapHeader">
<sd:Session SessionID="23456" BeginNewTransaction="yes"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>