Why the PW sdk aaApi_Login(...) return false always?

Hi,

the aaApi_Initialize(0) return true, But the aaApi_login(...) can't login successfully.

The messsge of last error is  "Cannot login to the datasource".

I have try it on Win7 is OK, But on the Windows10 return false always.

Why???

Thanks'

  • What version of ProjectWise are you using, both for ProjectWise Explorer and for ProjectWise SDK?  Can you share a code snippet of how you are calling the functions?  What development environment are you using (version of Visual Studio, etc.)?

  • Hi,

    Thanks'

    Local PC ==> VS2015.  PW ss4 , compile with Any Cpu, PATh add "C:\Program Files(X86)\Bentley\ProjectWise\bin"

    int dscnt = PWWrapper.aaApi_SelectDatasourcesByServer2(0, serverIPText, 0);   <==always can't get datasources on IE

    The PW server has added the "C:\Program Files\Bentley\ProjectWise\bin" to PATH variable

    When I compile the ASP on VS2015, what's path  C:\Program Files\... or C:\Program Files(X86)\... I need to use?

    Now, The function aaApi_SelectDatasourcesByServer2() return true on VS2015 environment, But always return false on IE.

  • Hi Ron, I will try to answer each item.

    It should work better if you complie x64 and use the path c:\Program Files\... on your C# declarations so that you don't need the PATH variable set.  I always call aaApi_Initalize, then aaApi_Login, then aaApi_GetActiveDatasource.  I store the result from aaApi_GetActiveDatasource so that I can call aaApi_LogoutByHandle to log out.

    However, if what you have is working on the PC, then you may be having a permissions problem on the IE. Be sure that the user that IE is running as has access to the Bin folder so that it can run the DLL files there.  Also check the location of the ProjectWise Explorer install. It may not have been installed to the same location as it was on the PC.

    If ProjectWise Explorer is in a different location on the IE than on the PC then you would need to leave out the full path on the C# function declarations and use the PATH variable to make the DLL files discoverable.

    Answer Verified By: Afa Lin 

  • Hello,

    Is your issue resolved? I am facing the same issue. If your issue is resolved then can you please share the code . 

  • Hi,

    FYR

    bool init = PWWrapper.aaApi_Initialize(0);
    StringBuilder cookie = new StringBuilder("", 1024);
    bool lret = PWWrapper.aaApi_WebLogin(pwdb, pwusername, pwpassword, pwserver, cookie, 1024);