Verastream SDK for Airlines
Using the Verastream SDK with Active Server Pages

You can use Micro Focus Verastream SDK for Unisys and Airlines objects in Microsoft Active Server Pages (ASP).

Note

Refer to the ASP sample applications for examples of how to set up an Active Server Page that uses SDK objects.

COM and .NET applications developed with the Verastream SDK do not support the 64-bit JRE. For these applications, use the 32-bit JRE.


Following are some basic guidelines on using SDK objects with ASP:

  1. Include a Global.asa file in the virtual directory of an Micro Focus Verastream SDK for Unisys and Airlines application. The Global.asa file is a file maintained on a Microsoft Internet Information Server (IIS) for the application. This file is processed automatically by the server when:

    • The application starts and stops

    • Individual users start and stop browser sessions that access the application's Web pages

    The Global.asa file typically contains scripts to declare objects, initialize application or session variables, connect to databases, send cookies, initialize and terminate sessions or applications, and perform other operations that pertain to the application as a whole.

    Note A Global.asa file may be created for you automatically, depending on the development tool you are using.
  2. Use the ASP intrinsic Session object to store user session variables. This object is responsible (on the Web server) for equating requests from a specific client. (The ASP Session object is in no way related to the Micro Focus host Session object, AtmSession.)

    Caution It is possible that set object=nothing may be ignored by IIS and the object placed in an "instant ready" pool to be used by the next server.createobject request.

    Another issue to be aware of is threading. Once a session-level ASP object is created, it is attached to a specific, discrete thread. That thread cannot be destroyed until all users assigned to that thread either %session.abandon% or their ASP session times out. Objects created with a session scope (for example, set session("whatever")=server.creatobject("whatever.id")) do not scale well and are affected by the threading issues in the following way:

    • You tie the ASP session down to a particular thread (instead of ASP being able to use any thread from the thread pool).                                
    • If you place a object marked Apartment into the ASP SessionObject, you have an object that can only live and be called from the Single-Threaded Apartment (STA) it was created in. ASP must then run all requests for that session in that STA.

      If you don't do this (or only place Apartment Neutral Objects in the SessionObject), ASP will run requests for that session on the first available thread.
  3. When an ASP session terminates, use the Session_OnEnd event procedure to disconnect the Micro Focus Session object and to remove references to all Micro Focus Verastream SDK for Unisys and Airlines objects that have been created. For example:
    Sub Session_OnEnd 
      if IsObject(screenObj) then
        screenObj.Close
        screenObj = Nothing
      end if
    End Sub
    

  4. Set IIS Options for Your Application:

    Following are several options that you must set within IIS.

    • Make sure the directory in which you store your ASP application has at least Scripts Only permission (for the Execute Permissions option) enabled.
                     
    • Enable session state for the application.                

      When session state is enabled, Active Server Pages creates a session for each user who accesses the ASP application so that you can identify the user across pages in the application. If you do not enable this option, ASP does not track users and does not allow an ASP script to store information in the Session or Application object, or use the Session_OnStart or Session_OnEnd events.

    • Enable 32-bit applications.
    • Enter an appropriate value for the session timeout. An ASP session automatically ends if the user has not requested or refreshed a page in an application by the end of the timeout period (the default period is 20 minutes). It is recommended that you enter a value of 5 (minutes) for the Session Timeout. Limiting the session timeout value can be important because an SDK object is not automatically freed from memory when a user closes a client application (browser); it is only freed when the timeout value is reached.                

      You can change the timeout period on the IIS user interface or with a script, using the Session.Timeout parameter. A script can also explicitly end a session by using the Session.Abandon method. Even when session state is enabled for an application, you can disable session state for an individual ASP page by using the @enablesessionstate=false directive.

Related Topics
Development Tools Supported
ActiveX Technologies Supported
Sample Applications Overview