Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Services Security version (or folder name) through Vault API

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
848 Views, 3 Replies

Get Services Security version (or folder name) through Vault API

A Vault client stores some local objects (e.g. Shortcuts) in path with next structure: "C:\Users\user\AppData\Roaming\Autodesk\VaultCommon\Servers\<Services_Security_version>\<ServerName>\Vaults\<VaultName>\Objects\Shortcuts.xml".

 

For the Vault 2020 the <Services_Security_version> == "Services_Security_1_7_2019",

for Vault 2019 => "Services_Security_1_16_2018".

 

QUESTION: Is there any way to get the <Services_Security_version> (version or name of folder) through Vault API ?

Labels (1)
  • API
3 REPLIES 3
Message 2 of 4
smilinger
in reply to: Anonymous

You can do it like this:

 

	var url = vaultConnection.WebServiceManager.DocumentService.Url;
	//var url = "http://server/AutodeskDM/Services/v24/DocumentService.svc";
	WebRequest request = WebRequest.Create($"{url}?wsdl");
	request.Proxy = null;

	var xmlDoc = new System.Xml.XmlDocument();

	using (WebResponse response = request.GetResponse())
	using (Stream stream = response.GetResponseStream())
		xmlDoc.Load(stream);

	string tns = xmlDoc.DocumentElement.Attributes["targetNamespace"].Value;
	var tnsParts = tns.Split('/', StringSplitOptions.RemoveEmptyEntries);
	var dateParts = tnsParts.Skip(tnsParts.Length - 3);
	var serverNamespace = $"Services_Security_{string.Join('_', dateParts)}";

 

Message 3 of 4
smilinger
in reply to: smilinger

Forget my former post, you should use this:

VDF.Vault.Library.LocalFileLocation.GetVaultCommonConnectionPath(
    conn: connection,
    serverSpecific: true,
    serverVersionSpecific: VDF.Vault.Currency.Connections.CommonPreferenceVersionRequirements.VersionSpecific,
    vaultSpecific: true
    );

 

Message 4 of 4
Anonymous
in reply to: smilinger

Thank you for both solutions.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report