Page 1 of 1

Vault API fails on ProcessComandListFolder

Posted: Mon Jul 06, 2015 1:10 am
by CGauntS
Hello. I am using Vault 7.1.0, with the appropriate version of the API. I have been building an application that compares different versions of files and generate a simple report based on the comments between releases. I have been able to successfully create a simple GUI for it, and have the system login, as well as get the repository list, but I have been unable to get a list of folders within the test repository.

I tried to use

Code: Select all

        string RootFolder = "$/";
        VaultClientFolderColl folders = ServerOperations.ProcessCommandListFolder (RootFolder, true).Folders;
to no avail, as all I get is a NullReferenceException within Vault's API itself (VaultClientIntegrationLib.dll). I am confused about why it is not working. Is this supposed to be done some other way?

Re: Vault API fails on ProcessComandListFolder

Posted: Tue Jul 07, 2015 1:39 pm
by jclausius
In your login, is a valid repository name provided to the Login Options? Another thing you can check is after the Login has completed, ServerOperations.client.ClientInstance should be valid, and also that should have another member: ServerOperations.client.ClientInstance.Repository. Is that value null or is it instantiated?

If not, the Repository name may be invalid or you may need to call SetRepository().

Re: Vault API fails on ProcessComandListFolder

Posted: Tue Jul 07, 2015 1:44 pm
by mskrobul
It is hard to say what is going on without looking at the rest of your code, but I just wrote this little test and ProcessCommandListFolder did work without any exceptions for this simple case:

Code: Select all

			ServerOperations.SetLoginOptions("http://localhost/VaultService", "admin", "admin", "Initial Repository", false);
			ServerOperations.Login();

			string RootFolder = "$/";
			VaultClientFolderColl folders = ServerOperations.ProcessCommandListFolder (RootFolder, true).Folders;

The VaultClientIntegrationLib Source code is included with the API download. You can load the actual VaultClientIntegrationLibAPI.csproj into your solution, reference and debug it if necessary.

Re: Vault API fails on ProcessComandListFolder

Posted: Wed Jul 08, 2015 1:15 am
by CGauntS
It appears the issue was indeed the repository. Upon closer inspection, the string I was passing in was wrong... Not it seems to be working fine. Thank you for the help.

Re: Vault API fails on ProcessComandListFolder

Posted: Wed Jul 08, 2015 8:20 am
by jclausius
Glad you figured it out. Thanks for the update.