Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WCF Sage Accpac 6.0 login error

Status
Not open for further replies.

PrisWine

Programmer
Oct 29, 2012
11
LK
I'm develoing WCF with VS 2010 for Sage ACCPAC 6.0 , but when trying to login with valid login credentials , still the inner exception says invlid signon informattion , the code is listed below , need some help.

The UserBL._accpacSession.Open method returns an Exception

WCF server code

Code:
 public class ACCPACLoginServiceManager : IACCPACLogInService
    {
        public bool InitiateConnection(string papplicationID, string pprogramName, string pprogrameVersion, string user, string password, string company, ref string errMsg)
        {
            try
            {
                UserBL.applicationID = papplicationID;
                UserBL.programName = pprogramName;
                UserBL.programeVersion = pprogrameVersion;

                UserBL._userID = user;
                UserBL._userPassword = password;
                UserBL._companyID = company;
                UserBL._accpacSession = new Session();
                UserBL._accpacSession.Init("", UserBL.applicationID, UserBL.programName, UserBL.programeVersion);
                UserBL._accpacSession.EnforceAppVersion = false;
                UserBL._accpacSession.Open(UserBL._userID, UserBL._userPassword, UserBL._companyID, DateTime.Now, 0);
                return true;
            }
            catch (Exception error)
            {
                errMsg = error.Message;
                return false;
            }
            finally
            {
                UserBL._accpacSession.Dispose();
            }
        }

    }

WCF Client code
Code:
 string VERSION = ConfigurationManager.AppSettings["ACCPAC_VERSION"].Trim();
        string USERID = ConfigurationManager.AppSettings["ACCPAC_BD_USERID"].Trim();
        string PASSWORD = ConfigurationManager.AppSettings["ACCPAC_DB_PASSWORD"].Trim();

string MAINDB = "DXDXDT";

 accpaclogin.InitiateConnection("AS", "AS1000", VERSION, USERID, PASSWORD, MAINDB, ref errMsg);


 
@ettienne thanks for reply but Password is UPPER case or Lower case same issue is there ,
the server application is hosted in the IIS 7 , client application is a windows form application , I have added the app.manifest file also , so the windows client will run on windows 7 OS as Administrator privilege, still same error occurs
 
Either company ID is wrong, or user ID is wrong or password is wrong.

Sage 300 Certified Consultant
 
@ettienne , unfortunately this accpaclogin.InitiateConnection("AS", "AS1000", VERSION, USERID, PASSWORD, MAINDB, ref errMsg); line of code works for Windows Application without WCF code (standalone application without IIS , with the same parameters given) , so it seems that it is NOT the User name , password or Company name issue (I have hard coded the values under WCF server application same issue is there )

Hope for a better answer
 
Typically you should be using XY for your app and XY0001 for the program name. Make sure that your version is in XXY format e.g. 63A.

Make sure that the date parameter value is a valid date, especially if you're connecting to sample data.

Are you sure that your call to .init worked? Perhaps arrange your code with two try..catch..finally constructs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top