Try OpenEdge Now
skip to main content
Developing AppServer Applications
Programming the AppServer : Managing state-free and stateless client context : Passing the client context identifier between client and server
 

Passing the client context identifier between client and server

OpenEdge provides a class, Progress.Lang.OERequestInfo, and its properties to hold the value of the client context identifier and related context information. OpenEdge provides instances of OERequestInfo for reference by attributes on both the server object handle that an ABL client uses to make remote requests to an AppServer, and on the SESSION system handle on the AppServer agent that processes the request. These attribute references include:
*On a client's server object handle (or a returned asynchronous request object handle):
*REQUEST-INFO — Referencing context information that is sent with a client request to the AppServer associated with this handle
*RESPONSE-INFO — Referencing context information that is returned to the client with the response from the most recent request sent to the AppServer associated with this handle
*On the AppServer agent's SESSION handle:
*CURRENT-REQUEST-INFO — Referencing context information that is received from the current client request to the AppServer. This is the same information that the client sends from the REQUEST-INFO attribute on the server object handle associated with the request.
*CURRENT-RESPONSE-INFO — Referencing context information that is returned from the AppServer in response to the current client request. This is the same information that the client receives in the RESPONSE-INFO attribute on the server object handle associated with the request.
The ClientContextId property on an OERequestInfo object holds the client context identifier value that is generated and passed between a client and AppServer. Additional properties identify other information about the request, including the remote procedure call (ProcedureName), a unique ID that OpenEdge generates for each request (RequestId), and OpenEdge release information (VersionInfo) about the AppServer client that initiates the request or the AppServer agent that returns the response, depending on the attribute that provides the information.
As noted previously, the ClientContextId property value typically serves as a primary key to the client context information maintained in a context store for a user login session, which might be initialized by an authentication service that handles the user login. Subsequently, when the client executes a remote procedure on the AppServer, it again propagates the client context identifier (and related information) from the REQUEST-INFO attribute on the server handle, and the AppServer agent can then retrieve the identifier from its SESSION handle using the CURRENT-REQUEST-INFO attribute. Before the remote procedure returns, it can modify the context identifier referenced by the CURRENT-RESPONSE-INFO attribute on the SESSION handle, and the client can retrieve the updated identifier returned using the RESPONSE-INFO attribute on the server handle (or on the returned asynchronous request object handle for an asynchronous request).
For more information on these attributes and examples that access the ClientContextId property, see the reference entries for these attributes in OpenEdge Development: ABL Reference. For more information on using the ProcedureName property, see Accessing the name of the current remote procedure.