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
Preferred method of obtaining DocumentSe rvice?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm exploring the Vault 2012 SDK and I've come across the following effective code (not exactly the same code, however the same effective code) to obtain the DocumentService in the "VaultList" sample:
Dim serverName As String = "localhost" Dim vaultName As String = "Vault" Dim userName As String = "Administrator" Dim password As String = "" Dim secSrv As SecurityService = New SecurityService() secSrv.SecurityHeaderValue = New Autodesk.Connectivity.WebServices.SecuritySvc.SecurityHeader secSrv.Url = "http://" + serverName + "/AutodeskDM/Services/SecurityService.asmx" secSrv.SignInReadOnly(userName, password, vaultName) Dim docSrv As DocumentService = New DocumentService() docSrv.SecurityHeaderValue = New Autodesk.Connectivity.WebServices.DocumentSvc.Secu rityHeader docSrv.SecurityHeaderValue.UserId = secSrv.SecurityHeaderValue.UserId docSrv.SecurityHeaderValue.Ticket = secSrv.SecurityHeaderValue.Ticket docSrv.Url = "http://" + serverName + "/AutodeskDM/Services/DocumentService.asmx" Dim login As UserPasswordCredentials = New UserPasswordCredentials(serverName, vaultName, userName, password) Dim serviceManager As New WebServiceManager(login) Dim root As Folder = docSrv.GetFolderRoot()
' more code here...
However, the "VaultFileBrowser" has the following effective code:
Dim serverName As String = "localhost" Dim vaultName As String = "Vault" Dim userName As String = "Administrator" Dim password As String = "" Dim login As UserPasswordCredentials = New UserPasswordCredentials(serverName, vaultName, userName, password) Dim serviceManager As New WebServiceManager(login) Dim docSrv As DocumentService = serviceManagaer.DocumentService Dim root As Folder = docSrv.GetFolderRoot()
' more code here...
Which method is the preferred method of obtaining the DocumentService object? The method in "VaultFileBrowser" looks much cleaner. The only educated guess I can make for the method in "VaultList" is the use of the "SignInReadOnly" method. What are the disadvantages of the "VaultFileBrowser" method?
Kind regards,
Dave.
Solved! Go to Solution.
Re: Preferred method of obtaining DocumentSe rvice?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I've done a little more experimenting and found the following simplification of the effective code in "VaultList":
Dim serverName As String = "localhost" Dim vaultName As String = "Vault" Dim userName As String = "Administrator" Dim password As String = "" Dim secSrv As SecurityService = New SecurityService() secSrv.SecurityHeaderValue = New Autodesk.Connectivity.WebServices.SecuritySvc.SecurityHeader secSrv.Url = "http://" + serverName + "/AutodeskDM/Services/SecurityService.asmx" secSrv.SignInReadOnly(userName, password, vaultName) Dim docSrv As DocumentService = New DocumentService() docSrv.SecurityHeaderValue = New Autodesk.Connectivity.WebServices.DocumentSvc.Secu rityHeader docSrv.SecurityHeaderValue.UserId = secSrv.SecurityHeaderValue.UserId docSrv.SecurityHeaderValue.Ticket = secSrv.SecurityHeaderValue.Ticket docSrv.Url = "http://" + serverName + "/AutodeskDM/Services/DocumentService.asmx" Dim root As Folder = docSrv.GetFolderRoot() ' more code here...
The "VaultList" example does create a WebServiceManager object, however it seems redundant to operation of the "VaultList" project itself and I can successfully remove this object and still have this example run.
Which method is better?
Kind regards,
Dave.
Re: Preferred method of obtaining DocumentSe rvice?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Dave,
Both code examples are valid ways of signing in to Vault and initializing the various web services with proper security headers. As you've mentioned, using the web service manager is a little bit cleaner and it also provides some other benefits such as automatic re-sign in if your connection is invalidated. More information can be found here in Doug's blog post on JustOnesAndZeros.

Daniel Dulzo
Software Engineer
Autodesk, Inc.

