3.0

Table Of Contents
VMware, Inc. 35
Chapter 4 Lab Manager API Method Reference
Response
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";
binding.AuthenticationHeaderValue.organizationname = "MyOrg";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
//** Get Configuration object
LabManagerSoap.Configuration Config =
binding.GetSingleConfigurationByName("Config26");
//** Get configuration identifier and deployed status from object
int configurationId = Config.id;
bool deployed = Config.isDeployed;
//** Capture configuration if it’s deployed
if (deployed)
{
//** Save capture with date and time stamp
string captureName=Config.name + DateTime.Now.ToString();
string LMStorageServer = "LM Server";
binding.ConfigurationCapture(configurationId, captureName);
}
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
Field Data Type Description
configurationID int Configurationidentifierofthenewcapture.