2.4

Table Of Contents
VMware® Lab Manager SOAP API Guide
46 VMware, Inc.
Sample Code: C#
try
{
//** LabManagerSoap is the name of the web reference in Visual Studio
LabManagerSoap.VMwareLabManagerSOAPinterface binding = new
LabManagerSoap.VMwareLabManagerSOAPinterface();
//** Create login
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
//** Get Configuration object
LabManagerSoap.Configuration Config =
binding.GetConfiguration(26);
//** Write to the console all configuration properties
Console.WriteLine("Config name = " + Config.name);
Console.WriteLine("Config id = " + Config.id.ToString());
Console.WriteLine("Config description = " + Config.description);
Console.WriteLine("Config isPublic = " + Config.isPublic.ToString());
Console.WriteLine("Config isDeployed = " + Config.isDeployed.ToString());
Console.WriteLine("Config fenceMode = " + Config.fenceMode.ToString());
Console.WriteLine("Config type = " + Config.type.ToString());
Console.WriteLine("Config owner = " + Config.owner);
Console.WriteLine("Config dateCreated = " +
Config.dateCreated.ToString());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
GetConfigurationByName
Thiscalltakesthenameofaconfigurationandreturnsanarrayofconfigurations
matchingthatname.Configurationnamesarenotunique.Morethanoneconfiguration
withagivennamecanexist.Ifconfigurationswiththatnamedonotexist,anempty
arrayisreturned.
Syntax
Configuration [] config = GetConfigurationByName(“Config9”);