• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Vault Customization

    Reply
    Valued Contributor
    lornemartin
    Posts: 63
    Registered: 02-17-2011

    vault login with API

    212 Views, 9 Replies
    12-21-2011 05:05 PM

    I am trying to run the C# VaultFileBrowser sample program in the vault 2012 SDK.  Everything compiles ok, but when I run it and try to log in, I always get an error saying 'Error: Logon Failed'.  I am using exactly the same login info as when I normally log into the Vault. Does anybody have any idea of what could be going on?.

      The line that throws the exception is this:  

    ServiceManager = new WebServiceManager(new UserPasswordCredentials(
                        loginInfo.ServerString, loginInfo.Vault, loginInfo.Username, loginInfo.Password));

     I have a working program that uses the older way of logging in:

    public static void InitServices()
            {         
                secSrv.SecurityHeaderValue = new Autodesk.Connectivity.WebServices.SecuritySvc.SecurityHeader();
                secSrv.Url = "http://" + HOST + "/AutodeskDM/Services/SecurityService.asmx";
                secSrv.SignInReadOnly("lorne", "lorne", "Vault");
                
                docSrv.SecurityHeaderValue = new Autodesk.Connectivity.WebServices.DocumentSvc.SecurityHeader();
                docSrv.SecurityHeaderValue.UserId = secSrv.SecurityHeaderValue.UserId;
                docSrv.SecurityHeaderValue.Ticket = secSrv.SecurityHeaderValue.Ticket;
                docSrv.Url = "http://" + HOST + "/AutodeskDM/Services/DocumentService.asmx";
                
                propSvc.SecurityHeaderValue = new Autodesk.Connectivity.WebServices.PropertySvc.SecurityHeader();
                propSvc.SecurityHeaderValue.Ticket = secSrv.SecurityHeaderValue.Ticket;
                propSvc.SecurityHeaderValue.UserId = secSrv.SecurityHeaderValue.UserId;
                propSvc.Url = "http://" + HOST + "/AutodeskDM/Services/PropertyService.asmx";   
            }

      I notice that with this code I am signing in as read-only, could that be what is causing the login to fail in the sample program?

    Employee
    Posts: 414
    Registered: 12-12-2006

    Re: vault login with API

    12-22-2011 09:05 AM in reply to: lornemartin

    Run in the debugger and verify all that the inputs to UserPasswordCredentials are correct.  What is the ServerString value?

    I don't think this is a read-only issue.



    Doug Redmond
    Software Engineer
    Autodesk, Inc.
    http://justonesandzeros.typepad.com/

    Valued Contributor
    lornemartin
    Posts: 63
    Registered: 02-17-2011

    Re: vault login with API

    12-22-2011 09:16 AM in reply to: lornemartin

     

    Employee
    Posts: 414
    Registered: 12-12-2006

    Re: vault login with API

    12-22-2011 12:13 PM in reply to: lornemartin

    That all looks good and the WebServiceManager should be able to handle a server on a different port.

    The server you are connecting to, is it a Vault 2012 server?



    Doug Redmond
    Software Engineer
    Autodesk, Inc.
    http://justonesandzeros.typepad.com/

    Valued Contributor
    lornemartin
    Posts: 63
    Registered: 02-17-2011

    Re: vault login with API

    12-22-2011 02:04 PM in reply to: doug.redmond

    Yes, it is a Vault 2012 server. 


    doug.redmond wrote:

    That all looks good and the WebServiceManager should be able to handle a server on a different port.


    I'm not quite following, I do want to connect using the same port as when I 'normally' log in don't I?  The bottom screenshot on my previous post shows my normal log in values.

    Employee
    Posts: 414
    Registered: 12-12-2006

    Re: vault login with API

    01-03-2012 12:29 PM in reply to: lornemartin

    My port comment was referring to the fact that your server is not running on the default port 80.

     

    Some other things to check.

    - Which line of code is failing?  Is it the line that sets "ServiceManager" or the line that set "VaultExplorer"?

    - Are you using the basic version of Vault?



    Doug Redmond
    Software Engineer
    Autodesk, Inc.
    http://justonesandzeros.typepad.com/

    Valued Contributor
    lornemartin
    Posts: 63
    Registered: 02-17-2011

    Re: vault login with API

    01-03-2012 04:11 PM in reply to: lornemartin

    It's failing on the ServiceManager line.  The output window shows this:

    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in Microsoft.Web.Services3.dll
    A first chance exception of type 'System.Exception' occurred in Autodesk.Connectivity.WebServicesTools.dll

     We are using Vault Collaboration.

    Employee
    Posts: 414
    Registered: 12-12-2006

    Re: vault login with API

    01-04-2012 05:10 AM in reply to: lornemartin

    You are getting a configuration Exception from Microsoft.Web.Services3.  I think that's the problem.

     

    Either the app.config file has been modified or Web Service Extensions (WSE 3) is not installed.  WSE 3 is part of the Vault client and server install.  See this article for more information.  That should get the WebServiceManager to log in property.

     

    Note: The VaultExplorer line will fail if Vault Client is not installed.



    Doug Redmond
    Software Engineer
    Autodesk, Inc.
    http://justonesandzeros.typepad.com/

    Valued Contributor
    lornemartin
    Posts: 63
    Registered: 02-17-2011

    Re: vault login with API

    01-05-2012 05:21 PM in reply to: lornemartin

    I do have WSE installed and as far as I can tell from the article you referenced, it's setup properly, at least the config files look right. I don't have access to the server to do the test you describe. You mention that WSE is part of the vault install. I do remember installing it separately, so maybe something is not quite set up right. 

      I also see that I didn't copy all of the lines from the output window before, maybe that would point to a possibly different problem?

    'VaultFileBrowser.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
    A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll
    A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
    A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in Microsoft.Web.Services3.dll
    A first chance exception of type 'System.Exception' occurred in Autodesk.Connectivity.WebServicesTools.dll

     

    Employee
    Posts: 414
    Registered: 12-12-2006

    Re: vault login with API

    01-10-2012 07:54 AM in reply to: lornemartin

    Try running as an administrator to see if that clears up the security Exceptions.



    Doug Redmond
    Software Engineer
    Autodesk, Inc.
    http://justonesandzeros.typepad.com/