vault login with API

vault login with API

Anonymous
Not applicable
2,749 Views
9 Replies
Message 1 of 10

vault login with API

Anonymous
Not applicable

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?

0 Likes
2,750 Views
9 Replies
Replies (9)
Message 2 of 10

Redmond.D
Autodesk
Autodesk

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.

0 Likes
Message 3 of 10

Anonymous
Not applicable

 

0 Likes
Message 4 of 10

Redmond.D
Autodesk
Autodesk

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.

0 Likes
Message 5 of 10

Anonymous
Not applicable

Yes, it is a Vault 2012 server. 


@Anonymous.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.

0 Likes
Message 6 of 10

Redmond.D
Autodesk
Autodesk

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.

0 Likes
Message 7 of 10

Anonymous
Not applicable

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.

0 Likes
Message 8 of 10

Redmond.D
Autodesk
Autodesk

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.

0 Likes
Message 9 of 10

Anonymous
Not applicable

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

 

0 Likes
Message 10 of 10

Redmond.D
Autodesk
Autodesk

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



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes