jeudi 3 décembre 2015

MYOBAdvanced Web API LogOut - You have been logged out due to exceeding the number of users in the system

Our system logs In successfully in to MYOBAdvanced, do the stuff it needs to do (Create Sales orders, Quotes, etc) and then attempt to log Out.

However after the system is running for sometime, we start receiving the 'You have been logged out due to exceeding the number of users in the system.' error on MYOBAdvanced UI.

The screen.Logout() indicates that the logout process is successful still receiving the error on MYOBAdvanced UI.

Has this been already fixed in Acumatica 5.2.1567.33 or MYOBAdvanced(2015.3.2.1193) ?

Thanks.

Below is the code for reference: static Screen oScreen = new Screen();

    public static Boolean fConnect(string sCompany, ref string sError) {
        try { 
            oScreen.CookieContainer = new System.Net.CookieContainer();
            oScreen.AllowAutoRedirect = true;
            oScreen.EnableDecompression = true;
            oScreen.Timeout = 200000;  // Timeout set to 2 min
            oScreen.Url = sCompany;
            return true;
        }
        catch (Exception ex){
            sError = "ERR~~fConnect " + ex.Message;
            return false;
        }
    }

    public static string fLogin(string sCompany, string sUser, string sPwd) {
        try {
            String sError = "";
            Boolean bConnect = fConnect(sCompany, ref sError);

            if (!bConnect){
                return "ERR~Unable To Connect To Company File <" + sCompany + "> " + sError;
            }

            LoginResult oLogin = new LoginResult();
            oLogin = oScreen.Login(sUser, sPwd);  

            oScreen.SetLocaleName(CultureInfo.CurrentCulture.Name);

            if (oLogin.Code == 0){
                String sDBVersion = "";
                if (fCheckDBVersion(ref sDBVersion, ref sError))
                {
                    return "OK ~~";
                }
                else 
                {
                    return "ERR~~fLogin " + sError; 
                };
            }
            else {
                return oLogin.Message;
            }
        }
        catch (Exception ex){
            Debug.WriteLine(ex.Message);
            return "ERR~~fLogin " + ex.Message; 
        }
    }
    public static String fLogOut()
    {
        try
        {
            oScreen.Logout();
            return "OK ~~";
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
            return "ERR~~fLogOut " + ex.Message;
        }
    }

Aucun commentaire:

Enregistrer un commentaire