NonStop SOAP 4.1 User's Manual

Example 27 Begin a New Session and Transaction Combined
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" BeginNewTransaction="yes"/>
</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="234567"/>
</soapenv:Header>
<soapenv:Body>
.
.
</soapenv:Body>
</soapenv:Envelope>
NOTE: The value returned in the SessionID attribute (234567) is the TMF transaction ID.
Continue a Transaction within a Session
To continue an active transaction under a 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
SessionID value supplied in the previous response from NonStop SOAP 4 for this session.
On receiving a SOAP request to continue an active transaction under a session:
1. The NonStop SOAP 4 server resumes the TMF transaction specified in the SessionID attribute
of the transaction header block in the SOAP request header element.
2. The NonStop SOAP 4 server performs the operation specified in the body under the resumed
transaction.
3. If the service does not return a fault or the AbortTransactionOnFault attribute is set to
no, the NonStop SOAP 4 server suspends the TMF transaction and returns the TMF transaction
ID in the SessionID attribute of the session header block in the SOAP response header
element.
4. If the service returns a fault and the AbortTransactionOnFault attribute is set to yes,
the SOAP 4 server will abort the TMF transaction and return a fault response to the client.
Because the previous value for SessionID is no longer valid (the transaction ID it represents
has been committed), the SOAP server generates a temporary session identifier to set in the
SessionID attribute, and returns it in the session header block in the response message.
Example 28 shows a request/response pair of messages to continue a transaction within a session.
Session Management and Transactions 253