project BLF > class PAuthentication > method GetUserRemote


Parameters


tGetUserSessionTokeninputtemp-table
tResponseUseroutputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method PAuthentication.GetUser


program code (program1/pauthentication.p)

If oiReturnStatus = 0
Then Assign oiReturnStatus = -98.

/* ==================================================================================================== */
/*  Make sure the right global session is used when activating the MfgPro session.                      */
/* ==================================================================================================== */
find first tGetUserSessionToken no-error.
if not available tGetUserSessionToken
then do:
    <M-2 run SetMessage
          (input  #T-1'The Global Session ID is not known in this call.':60(8155)t-1# (icMessage), 
           input  '' (icArguments), 
           input  '' (icFieldName), 
           input  '' (icFieldValue), 
           input  'S':U (icType), 
           input  1 (iiSeverity), 
           input  '' (icRowid), 
           input  'BLF-354':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in PAuthentication>
    assign oireturnstatus = -1.
end.
else assign vcGlobalSessionId = tGetUserSessionToken.tcSession_id.
<M-3 run SetQadContextProperty
   (input  'SessionId' (icPropertyName), 
    input  vcGlobalSessionId (icPropertyValue), 
    output viFcReturnSuper (oiReturnStatus)) in PAuthentication>
if viFcReturnSuper <> 0
then do:
    assign oiReturnStatus = viFcReturnSuper.
    <M-4 run SetMessage
       (input  #T-2'The -$1- property could not be set in the internal service context.':100(8066)T-2# (icMessage), 
        input  'SessionId':U (icArguments), 
        input  '' (icFieldName), 
        input  '' (icFieldValue), 
        input  'S':U (icType), 
        input  1 (iiSeverity), 
        input  '' (icRowid), 
        input  'BLF-355':U (icFcMsgNumber), 
        input  'The internal context property could not be set.  This is an internal error.':U (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in PAuthentication>
    return.
end.

empty temp-table ttGetUserSessionToken.

for each tGetUserSessionToken:
    create ttGetUserSessionToken.
    assign ttGetUserSessionToken.tt_session_id = tGetUserSessionToken.tcSession_id.
end.

assign vhIn = dataset dsASGetUserRequest:handle
       vhOut = dataset dsASGetUserReponose:handle
       vhInOut = ?.
       
Create Dataset vhInOut in widget-pool "non-persistent".
vhInOut:name = "CallService".

<M-1 run CallService
   (input  '':U (icProgramName), 
    input  'getUserRemote':U (icMethodName), 
    input  vhIn By-reference (izInput), 
    input-output vhInOut By-reference (bzInputOutput), 
    input-output vhOut By-reference (bzOutput), 
    input  '' (icAsyncHandler), 
    output viFcReturnSuper (oiReturnStatus)) in PAuthentication>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
then do:
    delete object vhInOut.
    return.
end.

empty temp-table tResponseUser.

for each  ttResponseUser :
    create tResponseUser.
    assign tResponseUser.tcUserid             = ttResponseUser.tt_userid
           tResponseUser.tcMfgClientPrincipal = ttResponseUser.tt_client_principal.
end.

delete object vhInOut.

If oiReturnStatus = -98
Then Assign oiReturnStatus = 0.