I'm developing WCF with VS 2010 for Sage ACCPAC 6.0 , but when trying to login with valid login credentials , still the inner exception says invalid sign on information , the code is listed below , need some help.
The UserBL._accpacSession.Open method returns an Exception
WCF server 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
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);
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