Previous Next

RESPONSE-INFO attribute
An object reference to a Progress.Lang.OERequestInfo class that provides information returned from an AppServer about its response to an AppServer client request.
Data type:
Access:
Applies to:
The following code fragment retrieves the client context identifier (CCID) that is returned from a call to the remote procedure, remote.p:
 
DEFINE VARIABLE hAppSrv  AS HANDLE NO-UNDO.
DEFINE VARIABLE ccid     AS CHARACTER NO-UNDO.
DEFINE VARIABLE bOK      AS LOGICAL.
 
CREATE SERVER hAppSrv.
bOK = hAppSrv:CONNECT("-URL AppServerDC://asHost:asPort/svc").
RUN remote.p ON SERVER hAppSrv.
 
ccid = hAppSrv:RESPONSE-INFO:ClientContextId.
You can also access this attribute from inside of an ABL event procedure that runs when an associated asynchronous remote procedure call completes. This attribute is read-only on the asynchronous request object handle that you access within the event procedure using the SELF system handle.
The following code fragment defines an event procedure (AsynReqIsDone) that you might use to access this attribute in response to an asynchronous remote procedure call:
 
DEFINE VARIABLE ccid AS CHARACTER NO-UNDO.
 
/* Assume the following procedure has been specified as the  */
/* event procedure for an asynchronous remote procedure call */
 
PROCEDURE AsynRqIsDone:
 
  ccid = SELF:RESPONSE-INFO:ClientContextId.
  DELETE OBJECT SELF.
END.
This event procedure accesses the CCID that is returned from the AppServer and assigns the value to the ccid variable defined in the enclosing external procedure.
The bold code in the following fragment shows getting a client principal from a server’s server’s OERequestInfo instance:
 
DEFINE VARIABLE hAppSrv      as HANDLE.
DEFINE VARIABLE hCPIn        as HANDLE.
DEFINE VARIABLE hCPOut       as HANDLE.
DEFINE VARIABLE ccid         as CHARACTER.
DEFINE VARIABLE bOK          as LOGICAL.
DEFINE VARIABLE loginState   as CHARACTER.
 
CREATE SERVER hAppSrv.
ccid = hAppSrv:REQUEST-INFO:clientContextID.
 
CREATE CLIENT-PRINCIPAL hCPIn.
hCPIn:INITIALIZE("userName@domainName", ccid, ?, "password").
 
hAppSrv:REQUEST-INFO:SetClientPrincipal(hCPIn).
 
bOK = hAppSrv:CONNECT("-URL AppServerDC://asHost:asPort/svc").
 
hCPOut = hAppSrv:RESPONSE-INFO:GetClientPrincipal().
IF VALID-HANDLE(hCPOut)
THEN loginState = hCPOut:LOGIN-STATE.
ELSE loginState = ?.
 
. . .
 
IF VALID-HANDLE(hCPOut)
   THEN DELETE OBJECT hCPOut.
See also:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.