Esempio n. 1
0
        private GlobalService.APIRequestHeader CreateGlobalRequestHeader(string sessionToken)
        {
            // ResourceTODO: SessionTokenNotInitialized
            if (sessionToken == null)
            {
                throw new ArgumentNullException("sessionToken", "The betfair session token has not been initialised.");
            }

            GlobalService.APIRequestHeader requestHeader = new GlobalService.APIRequestHeader();
            requestHeader.sessionToken = sessionToken;
            return(requestHeader);
        }
Esempio n. 2
0
        private void LogOutOfService()
        {
            //
            if (string.IsNullOrWhiteSpace(_sessionToken))
            {
                return;
            }

            GlobalService.APIRequestHeader requestHeader = CreateGlobalRequestHeader(_sessionToken);

            GlobalService.LogoutReq request = new GlobalService.LogoutReq();
            request.header = requestHeader;
            GlobalService.LogoutResp response = _globalService.logout(request);

            // TODO: Error handling.

            // Track the session token.
            // Even when logging out?? That's like drawing some petty cash from ATM before dying.
            // MaintainGlobalSession(response.header);
        }