Autodesk Vault Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.Secu rityHeader();
secSrv.Url = "http://" + HOST + "/AutodeskDM/Services/SecurityService.asmx";
secSrv.SignInReadOnly("lorne", "lorne", "Vault");
docSrv.SecurityHeaderValue = new Autodesk.Connectivity.WebServices.DocumentSvc.Secu rityHeader();
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.Secu rityHeader();
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?
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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?
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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?
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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
Re: vault login with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try running as an administrator to see if that clears up the security Exceptions.


