Share via


Session Element (XMLA)

Uses the SOAP header in a SOAP request message to identify an existing, explicit session on an instance of Microsoft SQL Server Analysis Services.

Namespace urn:schemas-microsoft-com:xml-analysis

Syntax


<soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      ...
      <Session
         xmlns="urn:schemas-microsoft-com:xml-analysis"
         SessionId="string" />
      ...
   </soap:Header>
   <soap:Body>
      ...
   </soap:Body>
</soap:Envelope>

Element Characteristics

Characteristic

Description

Data type and length

None

Default value

None

Cardinality

0-1: Optional element that can occur once and only once.

Element Relationships

Relationship

Element

Parent elements

None

Child elements

None

Attributes

Attribute

Description

SessionId

Required String attribute that identifies the session to be used. Analysis Services uses a globally unique identifier (GUID) to identify a session.

Remarks

The Session header element identifies an existing, explicitly started session on the Analysis Services instance. The Session element is part of the SOAP header in the following types of messages:

  • A SOAP response that contains a BeginSession SOAP header element.

  • A SOAP request to identify the session on which to run the Discover or Execute method.

A session identifier does not guarantee that a session remains valid. The session specified in the Session element can expire. For example, a session can expire if the session times out or the connection associated with the session is disconnected. If the session expires and is no longer valid, Analysis Services ends the session and rolls back any transaction currently in process. Any SOAP message sent with a session identifier that is no longer valid fails with a SOAP fault indicating that the specified session cannot be found.

If a Session element is not sent as part of a SOAP request, the Analysis Services instance implicitly begins a session for the duration of the Discover or Execute method call, and then ends that session once the method call has completed.

See Also

Reference

EndSession Element (XMLA)

Concepts

Managing Connections and Sessions (XMLA)

Other Resources

Headers (XMLA)