Freigeben über


3.1.3.1 Initialization for Non-HTTP Transport

To begin the session, the client adds a BeginSession SOAP header to the request.

 <?xml version="1.0" encoding="utf-8"?>
 <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   <Header>
     <BeginSession xmlns="urn:schemas-microsoft-com:xml-analysis" mustUnderstand="1"/>
    </Header>
    <Body>
     ...<!-- Discover or Execute element goes here.-->
    </Body>
 </Envelope>

The SOAP response message from the server includes the session ID in the SOAP header.

 <Header>
  <Session
   xmlns="urn:schemas-microsoft-com:xml-analysis"
   SessionId="537C61C6-827C-4305-83A6-C8CE4A91001B"/>
 </Header>

For each subsequent request, the client MUST include the session ID that is provided by the server.

 <Header>
  <Session
   xmlns="urn:schemas-microsoft-com:xml-analysis"
   mustUnderstand="1"
   SessionId="537C61C6-827C-4305-83A6-C8CE4A91001B"/>
 </Header>

To end the session, the client MUST send the EndSession header that contains the related session ID value to the server.

 <Header>
  <EndSession
   xmlns="urn:schemas-microsoft-com:xml-analysis"
   mustUnderstand="1"
   SessionId="537C61C6-827C-4305-83A6-C8CE4A91001B"/>
 </Header>

Sessions MUST be supported on the server.<117>

Multiple commands can be executed in the context of a single session. The server MAY<118> choose to time out an active session after a period of inactivity.

The following tables list the SOAP header elements and attributes that this protocol defines for initiating, maintaining, and closing a session.

SOAP Header

Description

BeginSession

This header requests that the server create a session. The server is to respond by constructing a new session and returning the session ID in the Session header in the SOAP response.

Session

This header is required for every method call that is to occur in the session. The session ID MUST be included in the header.

EndSession

This header is used to end the session. The session ID MUST be included in the header.

SOAP Header

Attribute

Description

Session

SessionID

The token that was received from the server in response to the BeginSession request.

EndSession

SessionID

The token that was received from the server in response to the BeginSession request.

If the session ID that is specified in the Session or EndSession SOAP header is not valid or has timed out, then the server MUST return a SOAP fault.