I am trying to get all the naming schemes using the following code,
I am geting a null exception and soap exception.
VDF.Vault.Currency.Connections.Connection connection = e.Context.Application.Connection; FileNmngSchm[] fns = connection.WebServiceManager.DocumentService.GetAllFileNamingSchemes(); //error; foreach (var fsn_value in fns) { lView.Items.Add("================================"); lView.Items.Add("Length: " + fsn_value.FieldLen.ToString()); lView.Items.Add("Descr: " + fsn_value.Descr.ToString()); lView.Items.Add("Id: " + fsn_value.Id.ToString()); lView.Items.Add("IsDflt: " + fsn_value.IsDflt.ToString()); lView.Items.Add("Name: " + fsn_value.Name.ToString()); lView.Items.Add("Prefix: " + fsn_value.Prefix.ToString()); lView.Items.Add("StartNum: " + fsn_value.StartNum.ToString()); lView.Items.Add("Suffix: " + fsn_value.Suffix.ToString()); lView.Items.Add("================================"); }
Solved! Go to Solution.
Solved by smithmat. Go to Solution.
You need to provide more information:
- Matt
Null exception at
lView.Items.Add("Length: " + fsn_value.FieldLen.ToString());
soap exception 106.
Vault 2015
yes its an explorer application, the code lives in the main claas inside the command.
could you give me code on how to access all the naming schemes, that would be great.
Guys,
If anyone can provide me code snippet on how to get list of all the naming schemes that are stored that would be great.!!
Thanks.
I'm confused: are you getting a null reference exception or a soap exception?
For SoapException 106, here is the help information:
TransactionInvalidPrincipal
An example would be making a call without being logged into a vault for methods that require a vault
Do you have a logged in connection to vault?
Is fns null when it comes back? Or are you saying that fsn_value is null?
- Matt
I am getting the following null exception
--------------------------- Vault Professional 2015 --------------------------- System.NullReferenceException: Object reference not set to an instance of an object. at VaultADVTools.Apps.BulkFileCreator.btn_createFolders_Click(Object sender, create1.cs:line 74
Yes I have a logged in connection and its working working if i try to get folder list of files, etc.
I tried the following code to get that message.
FileNmngSchm[] fns = GV.m_connection.WebServiceManager.DocumentService.GetAllFileNamingSchemes(); //FileNmngSchm fn = ; if (fns.Equals(null)) { lView.Items.Add("null"); } lView.Items.Add("Length: " + fns.Length);
It says fns is null.
I can confirm the behavior that GetAllFileNamingSchemes returns null in Vault 2015 even when there are file naming schemes existing. I would assume that that is a defect.
It appears that Vault Explorer uses the method GetNumberingSchemesByType. So, you should be able to use that to work around the issue.
Hope that helps,
- Matt