NonStop SOAP 4.1 User's Manual
Example 25 Begin a New Session
Client Request
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:compaq_nsk_oss_SoapHeader">
<soapenv:Header>
<urn:Session SessionCommand="Begin"/>
</soapenv:Header>
<soapenv:Body>
.
.
.
</soapenv:Body>
</soapenv:Envelope>
NonStop SOAP 4 Response
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:compaq_nsk_oss_SoapHeader">
<soapenv:Header>
<urn:Session SessionID="Tempmj12rty67"/>
</soapenv:Header>
<soapenv:Body>
.
.
</soapenv:Body>
</soapenv:Envelope>
NOTE: The SessionID value created in this step is called temporary because it has no practical
use. The SessionID assumes the value once a transaction has started, which can be requested
in the same SOAP message as that used to start the session (and is recommended for efficiency).
Begin Transaction within a Session
To start a new transaction under an active session, the client must set the value of the SessionID
attribute (in the session header block of the NonStop SOAP 4 request header element) to the session
identifier. The client must also set the value of the BeginNewTransaction attribute in the session
header block of the SOAP request header element to yes.
To start a new TMF transaction within a session, NonStop SOAP 4 performs the following activities:
1. The SOAP server begins a TMF transaction in response to a client request.
2. If the body of the request invokes a target service, the SOAP server invokes the operation
specified in the body under the transaction that has started.
3. The NonStop SOAP 4 server suspends the TMF transaction and returns the response to the
client if the service does not return a fault or if the AbortTransactionOnFault attribute
is set to no.
4. The NonStop SOAP 4 server sets the TMF transaction ID in the SessionID attribute of the
session header block.
5. If the service returns a fault and the AbortTransactionOnFault attribute is set to yes,
the SOAP 4 server aborts the TMF transaction and returns a fault response to the client. The
SOAP server generates a temporary session identifier to set in the SessionID attribute (there
is no valid TMF Transaction ID to use), and returns it in the session header block in the response
message.
Example 26 shows shows a request/response pair of messages to begin a new transaction within
a session.
Session Management and Transactions 251










