Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2012 API webservice manager not releasing license at app close

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
664 Views, 3 Replies

2012 API webservice manager not releasing license at app close

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();

            }

        }

}

3 REPLIES 3
Message 2 of 4
Redmond.D
in reply to: Anonymous

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.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 4
Anonymous
in reply to: Redmond.D

Our deployment officer assures me that all current hotfixes, and specifically the login-related one are part of our standard installation. I am able to logout after logging in with the code below: WinAuthService my_wasvc = new WinAuthService(); my_wasvc.Url = Servicesbase + "WinAuth/WinAuthService.asmx"; my_wasvc.UseDefaultCredentials = true; my_wasvc.SecurityHeaderValue = new Autodesk.Connectivity.WebServices.WinAuthSvc.SecurityHeader(); my_wasvc.SignIn(vaultname); WinAuthCredentials my_cred = new WinAuthCredentials(servername, vaultname); my_mngr = new WebServiceManager(my_cred); Thanks for the help, Doug Tim
Message 4 of 4
Redmond.D
in reply to: Anonymous

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.



Doug Redmond
Software Engineer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report