Message 1 of 4
Not applicable
04-11-2012
06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.SecurityHeader 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.
