3.0

Table Of Contents
Lab Manager SOAP API Guide
24 VMware, Inc.
static void CaptureUndeployConfiguration(string configname)
{
//
//** Bind to Lab Manager SOAP Web Service
//
LabManagerSoap.VMwareLabManagerSOAPinterface binding = GetLMAPI();
LabManagerSoap.Configuration config =
binding.GetSingleConfigurationByName(configname);
if ( perform_capture.Equals("Yes") )
{
Console.WriteLine("Capture configuration "+ configname);
int newConfigCaptureID = binding.ConfigurationCapture(config.id,
configname);
}
Console.WriteLine("Undeploy configuration "+ configname);
binding.ConfigurationUndeploy(config.id);
Console.WriteLine("Undeploy is completed");
}
/// <summary>
///The GetLMAPI() method creates a new binding to the Lab Manager API
///and sets up authentication and other basic parameters. This method
///returns a CertificateAcceptor object.
/// </summary>
static LabManagerSoap.VMwareLabManagerSOAPinterface GetLMAPI()
{
//
//** Bind to SOAP interface
//
LabManagerSoap.VMwareLabManagerSOAPinterface binding = new
LabManagerSoap.VMwareLabManagerSOAPinterface();
//
//**Allocate caller login object
//
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.Url = binding.Url.Replace("https://qa240.VMware.com",
"https:/demo44.VMware.com");
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "vlm";
binding.AuthenticationHeaderValue.organizationname = "MyOrg";
binding.Timeout = 10 * 60 * 1000; // 10 minutes
ServicePointManager.CertificatePolicy = new CertificateAccepter();
return binding; //** return binding reference
}
}