Search

 

Edition: Futurama Webservice

Module: Futurama WebAPI (from Futurama 17.07)

User: Developer

Prerequisites

- Experience with Futurama WebAPI

Introduction

Control the lifecycle of Futurama WebAPI Sessions

 

Managing Sessions within Futurama WebAPI (Futurama 17.07+)

Just like sessions within Futurama Web, the sessions within Futurama WebAPI have a restricted lifespan. By setting the session timeout in the web.config, any expired sessions are ended and deleted after the specified timespan. Frequently Futurama WebAPI is used in combination with another system (for example a portal with personal information for users). In order to give this portal the control about the session lifetime the Futurama functions SessionKeepAlive and SessionEnd can be used. Both can be called by using SOAP or RESTful web services.

SessionKeepAlive

By calling this function while providing an existing session’s ID value, the session timeout will be reset. This ensures that the session will not be ended prematurely. The functions result will contain the following fields:

  • Message: When the function is successful, this will contain the message ‘success’, otherwise an error will be written to this field.
  • NextTimeout: A timestamp for the next moment the sessions lifecycle will be ended.

SOAP Usage

To use this function using SOAP, a HTTP Post must be used on the relative URL /WebAPIService.svc

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:SessionKeepAlive>
         <ns:request>
            <ns:SessionID>{The sessionID for the session to keep alive}</ns:SessionID>
         </ns:request>
      </ns:SessionKeepAlive>
   </soapenv:Body>
</soapenv:Envelope>

Below an example of a response of this type of request

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <SessionKeepAliveResponse xmlns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
         <SessionKeepAliveResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <Message>Success</Message>
            <NextTimeout>2021-03-16T16:07:27.7805503+01:00</NextTimeout>
         </SessionKeepAliveResult>
      </SessionKeepAliveResponse>
   </s:Body>
</s:Envelope>

REST Usage

This function can be performed by a Http Post call to the relative URL /rest/webapi/SessionKeepAlive with the following JSON request object:

{ 
	sessionID: "The sessionID for the session to keep alive" 
}

Or by using an XML request object:

<SessionRequest xmlns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
	<SessionID>{The sessionID for the session to keep alive}</SessionID>
</SessionRequest>

SessionEnd

By calling this function with a sessionID, this sessions lifecycle will be ended. The functions result will consist of the following fields:

  • Message: When the function is successful, this will contain the message ‘success’, otherwise an error will be written to this field.

SOAP Usage

To use this function using SOAP, a HTTP Post must be used on the relative URL /WebAPIService.svc

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:SessionEnd>
         <ns:request>
            <ns:SessionID>The sessionID for the session to end</ns:SessionID>
         </ns:request>
      </ns:SessionEnd>
   </soapenv:Body>
</soapenv:Envelope>

Below an example of a response of this type of request

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <SessionEndResponse xmlns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
         <SessionEndResult>Success</SessionEndResult>
      </SessionEndResponse>
   </s:Body>
</s:Envelope>

REST Usage

This function can be performed by a Http Post call to the relative URL /rest/webapi/SessionEnd with the following JSON request object:

{
    sessionID: "{The sessionID for the session to end}"
}

Or by using an XML request object:

<SessionRequest xmlns="http://www.ActuIT.nl/Futurama/WebAPI/2014/10/">
	<SessionID>The sessionID for the session to end</SessionID>
</SessionRequest>

Related Topics

- Futurama WebAPI: Develop a Futurama application using WebAPI.

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2021-03-16