- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i am working on updating an add-in created for 2015r2 vault client to use in 2020 vault client. the basic function that is not working is UpdateFileLifeCycleStates(). the add-in does many search functions with the logged in vault user (windows authentication) and then needs to do the lifecycle update with a different user's credentials(vault user). i have verified the connection is being made but it feels like it is instantly being disconnected. im wondering if there is an issue with holding two connections at the same time.
im not very familiar with c# or or the SDK. the app was developed by someone else. below i will try to show the logins for both connections and the specific call that is failing
normal user log in. i believe the connection is grabbed at application launch and then can be connected again as needed with GetConnection()
public void OnLogOn(IApplication app)
{
_vault = app;
m_conn = app.Connection;
VaultBridge.Instance.Initialize();
}
public void GetConnection()
{
if(_vault == null)
return;
if(m_conn == null)
m_conn = _vault.Connection;
}web service login. used to make the state change. gets server and vault from normal login and user name and pass from a config file. i tested explicitly entering the strings instead and it works the same. included is the old connection that was used in 2015 that i commented out. i have used authflags for standard and server license with no success. note that the code uses Vlt instead of VDT.vault but the call is the same.
string sSvr = VaultExtension.m_conn.Server;
string sVlt = VaultExtension.m_conn.Vault;
string sUsr = Settings.Instance().GetConfigVal("VaultUser");
string sPW = Settings.Instance().GetConfigVal("VaultPW");
//ACWT.UserPasswordCredentials cred = new ACWT.UserPasswordCredentials(sSvr, sVlt, sUsr, sPW, false);
//ACWT.WebServiceManager mgr = new ACWT.WebServiceManager(cred);
//VaultExtension.myAdminConnection = new Vlt.Currency.Connections.Connection(mgr, sUsr, sPW, sVlt, 0, sSvr, 0);
Vlt.Results.LogInResult results = Vlt.Library.ConnectionManager.LogIn(sSvr, sVlt, sUsr, sPW, Vlt.Currency.Connections.AuthenticationFlags.ServerLicense, null);
Vlt.Currency.Connections.Connection myAdminConnection = null;
if (results.Success)
myAdminConnection = results.Connection;and finally the call to update the lifecycle.
VaultExtension.myAdminConnection.WebServiceManager.DocumentServiceExtensions.UpdateFileLifeCycleStates(new long[] { f.MasterId }, new long[] { relState }, "Prepared for release by - Vault Release Management Utility.");
i really cant figure out why the call to update lifecycle is failing with System.NullReferenceException every single time.
i promoted my vault account to the special level of admin created for the state change account and used UpdateFileLifeCycleStates() with my connection (replaced myadminconnection with m_conn) and it works fine. can anyone confirm or deny that it is possible to connect to the vault with two different methods and two different users from the same application? can anyone give me a quick way to verify the admin connection is working? i put a watch on the results.success and it was coming back true. i just have no way to know how long that connection is being held. is there something i need to do to the server to allow webservice connections that i didn't do? i logged in with the username and password directly and it can log into the vault client.
i tried to force a reconnection just before the lifecycle change because i thought something might have disconnected the admin connection while the searching was going on. it connected again (results.success = true) and went null again before it could change states.
any suggestions or questions are appreciated. i have been fighting this for maybe a week and i'm not getting anywhere.
Solved! Go to Solution.
