I am in the process of converting an app which we used with Vault 2011 Pro for use with Vault 2012 Pro. I have modified all our service calls to utilize a single webservice manager. However, I cannot get the manager to release the license for windows authentication users. I thought at the end of scope or when I call "my_webservicemanger.Dispose()" the log-out should automatically occur, but it is not. When users sign in without authentication, I can get the license released by calling "my_webservicemanager.SecurityService.SignOut()". Please see the sample code below.
What am I doing wrong or missing?
Thanks,
Tim
using Autodesk.Connectivity.WebServicesTools;
namespace myTool
{
staticclassProgram
{
staticvoidMain()
{
WebServiceManager my_mngr = null;
my_mngr = <Loginfunction>;
<code>
if (my_mngr.WinAuthService.SecurityHeader == null)
{ my_mngr.SecurityService.SignOut(); }
else
{ my_mngr.WinAuthService.Dispose(); }
my_mngr.Dispose();
}
}
}
How are you creating your WebServiceManager? Which credentials class are you using?
Not all credentials classes log in and log out. Sometimes they just re-use an existing connection.
I'm also assuming that you are using the 2 API-related hotfixes.
I ran a test and am not able to reproduce the problem. I ran my Vault server in debug mode and verified that the SignOut call gets made when the manager gets disposed.
Here is the code. Sign out gets called when the using block exits:
WinAuthCredentials cred2 = new WinAuthCredentials("localhost", "Vault");
using (WebServiceManager mgr = new WebServiceManager(cred2))
{
Folder root = mgr.DocumentService.GetFolderRoot();
}
When you use the WebServiceManager, you shouldn't ever have to set SecurityHeader information. And the cases are rare when you would ever need to read the SecurityHeader. I suggest removing any of your code that deals with SecurityHeaders.
Check the version on Autodesk.Connectivity.WebServiceTools.dll. If the version is 16.0.56.280, then you are using the hotfix.