NonStop SOAP User's Manual
NonStop SOAP Features and Functions
NonStop SOAP User’s Manual—520501-012
4-8
Ending a Session
Client Request to End a Session
To request an end to the session, the client sends a SOAP message specifying a value
of “End” for the SessionCommand attribute of the SOAP header.
If the body of the SOAP message contains a request, the SOAP server processes the
request, then ends the session. If the body of the SOAP message is empty, the SOAP
server ends the session. To signify the end of a session, the SOAP server returns a
response that does not include the session element.
If a transaction is associated with the specified session context, then by default, the
transaction is committed. The client has the option to specify the attribute
CurrentTransactionCommand with a value of “Abort” to override the default
behavior and abort the transaction. (This attribute cannot be specified in a request to
start a session.)
If a subsession is in progress, you cannot end the session. Wait for the dialog to end,
or abort the subsession if appropriate, before ending the session.
The SOAP server returns a SOAP fault if
•
Session ID is not specified
•
Invalid Session ID specified
•
Session associated with the Session ID has timed out
•
An error was encountered while aborting the transaction
•
An error was encountered while committing the transaction
•
A subsession is in progress
In Example 4-7, the client requests a service and indicates that this is the last request
of the session.
A response without a header signifies that the session has ended. The SOAP body
contains the response to the last request.
Example 4-7. Last Request of a Session
<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="UnC9BZ21FAKG" SessionCommand="End"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<GetBalance><ItemNo>10029389760</ItemNo></GetBalance>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>