Beispiel #1
0
        /// <summary>
        /// The API Login service enables customers to log in to the API 
        /// service and initiates a secure session for the user. 
        /// Users can have multiple sessions 'alive' at any point in time.
        /// </summary>
        private static void Login()
        {
            const string serviceName = "Login";
            Console.WriteLine("{0}$ API_SERVICE {1}", DateTime.Now, serviceName);
            var request = new LoginReq {username = _username, password = _password, productId = _productId};

            if (_vendorSoftwareId == 0 && _productId > 0)
            {
                // Used for Lignite
                _vendorSoftwareId = 1342;
            }
            request.vendorSoftwareId = _vendorSoftwareId;
            LoginResp response = _bfGlobalService.login(request);

            ValidateAPIResponse(serviceName, Convert.ToString(response.header.errorCode),
                                Convert.ToString(response.errorCode), response.header.sessionToken);

            _currency = response.currency;
        }
Beispiel #2
0
 /// <remarks/>
 public void loginAsync(LoginReq request) {
     this.loginAsync(request, null);
 }
Beispiel #3
0
 /// <remarks/>
 public void loginAsync(LoginReq request, object userState) {
     if ((this.loginOperationCompleted == null)) {
         this.loginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnloginOperationCompleted);
     }
     this.InvokeAsync("login", new object[] {
                 request}, this.loginOperationCompleted, userState);
 }
Beispiel #4
0
 public LoginResp login(LoginReq request) {
     object[] results = this.Invoke("login", new object[] {
                 request});
     return ((LoginResp)(results[0]));
 }