Share via


How SOAP Sessions Support Works

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

All SOAP sessions occur through request/response message pairs between the server and clients that include the optional sqlSession header to enclose all information related to SOAP sessions. sqlSession is case-sensitive and part of the sqloptions namespace.

After the server initiates SOAP sessions, the sessions are stored in the sys.dm_exec_sessions dynamic management view. This view returns the session IDs and the start time for each session. You can view this table by running the following query either in SQL Server Management Studio or by using the osql command-line utility:

SELECT * FROM [sys].[dm_exec_sessions]

SOAP sessions are expired based on a session time-out value. The default, or maximum session time-out for the server is set by using the CREATE ENDPOINT or ALTER ENDPOINT DDL statements. However, clients can request a time-out value that is less than the default interval. If a client requests a longer time-out than the server default, the time-out specified in the endpoint DDL statement overrides the client preference. For example, suppose the following CREATE ENDPOINT was used to establish an endpoint with sessions support:

CREATE ENDPOINT
   ...
SESSIONS=ENABLED
   ...
SESSION_TIMEOUT = 60

If a SOAP client then requested a session time-out that is longer than the server maximum, such as 90, the server maximum of 60 would override and be applied as the actual session time-out interval. If SESSION_TIMEOUT is not set in the endpoint DDL statement, the server does not time out sessions (infinite).

By default, HTTP endpoints do not have sessions enabled. To enable sessions on an endpoint, you must specify SESSIONS=ENABLED in the endpoint DDL.

Sessions persist only while the instance of SQL Server is online. All sessions are reset when the server is stopped and then restarted. Additionally, modifying the endpoint can affect open or new sessions that use that endpoint. For more information, see Altering Endpoints When You Use SOAP Sessions.

Note

All requests to join existing HTTP SOAP sessions must be authenticated. For more information, see Endpoint Authentication Types.

Sessions can be initiated or ended to modify their state, but they generally remain in either a "sleep" state, such as when the session has been initiated and is open at the server for client use; or a "dormant" state, such as when the session has been ended and the session is not currently available at the server for client use.

Note

Web Services Definition Language (WSDL) requests cannot participate in SOAP sessions. For more information about WSDL, see Using WSDL.