Try OpenEdge Now
skip to main content
ABL Reference
Class Properties and Methods Reference : SetClientPrincipal( ) method
 

SetClientPrincipal( ) method

Stores a deep copy (clone) of a client principal object in an OERequestInfo instance.
On successful execution this method returns TRUE.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.Lang.OERequestInfo class

Syntax

SetClientPrincipal( INPUT hClientPrincipal AS HANDLE )
hClientPrincipal
A handle that refers to a valid client principal object, or to the Unknown value (?). If hClientPrincipal is the Unknown value (?), then a client principal object within the OERequestInfo instance is deleted. If hClientPrincipal is invalid, the method returns FALSE.
The bold code in the following fragment shows setting a client principal in 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

GetClientPrincipal( ) method (Progress.Lang.OERequestInfo), CURRENT-REQUEST-INFO attribute, CURRENT-RESPONSE-INFO attribute, LOCAL-VERSION-INFO attribute, REQUEST-INFO attribute, RESPONSE-INFO attribute