I am trying to connect via the api to a Projectwise Server but get the error: Error 58064 "Cannot login to the datasourceInvalid user name and password combination."
And also this in the pw.log:
https://communities.bentley.com/communities/other_communities/sign-in_assistance_and_web_services/w/wiki/33057/connection-client-fails-to-sign-in
The username and password is set in the adminstrator as firstinitiallastname and the password which is what i am passing in. They use a cloud server with gateway servers on site. I am connecting to the cloud server. I am able to list the datasources on the server through the api.
1- Do you know what the username/password combination issue might be?
2- Optimally, they would rather connect to the local gateway server. This doesn't work at all through the api testing I tried. Is this possible?
HI there. Thank you for replying. The Explorer is able to login but not via this C# code below. I wrote a little test app to test this.
ProjectWiseAPI.aaApi_Initialize(0); //AAMODULES_ALL ProjectWiseAPI.aaApi_InitializeModules(0); success = ProjectWiseAPI.aaApi_Login(0, dsName, user, pass, ""); //dsname = "HOSTNAME:DSNAME"
Here is how I do it.
//Interface Declaration
//dialog suppressed [DllImport(@"C:\Program Files\Bentley\ProjectWise\bin\dmscli.dll", EntryPoint = "aaApi_Login", CharSet = CharSet.Unicode)] public static extern bool aaApi_Login(int iDSType, string lptstrDataSource, string lpctstrUsername, string lpctstrPassword, string lpctstrSchema);
[DllImport(@"C:\Program Files\Bentley\ProjectWise\bin\dmscli.dll", EntryPoint = "aaApi_GetActiveDatasource", CharSet = CharSet.Unicode)] public static extern IntPtr aaApi_GetActiveDatasource();
//Use of interface
public static bool LogIn(string dsName) { string adminName = "MyUserName"; string pw = "MyPAssword";
aaApi_Initialize(1/*AAMODULE_EXPLORER*/); if (false == aaApi_Login(0, dsName.ToString(), adminName, pw, "")) { return (false); } if (IntPtr.Zero == (hDatasource = aaApi_GetActiveDatasource())) { return (false); } return (true);
You can set the data type of username and password to IntPtr and pass IntPtr.Zero if you want the login to use Single Sign-on.