3.0

Table Of Contents
Lab Manager SOAP API Guide
56 VMware, Inc.
Sample Code: C#
try
{
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";
binding.Url =
"https://demo18.LabManager.com/LabManager/SOAP/LabManager.asmx";
binding.Timeout = 10 * 60 * 1000; // 10 minutes
ServicePointManager.CertificatePolicy = new CertificateAccepter();
//** Get Configuration object
LabManagerSoap.Configuration Config =
binding.GetSingleConfigurationByName("Win2kBEA");
//** If configuration is deployed, livelink it
if (Config.isDeployed)
{
string captureName= "Win2kBEA" + DateTime.Now.ToString();
string url = binding.LiveLink(Config.name);
Console.WriteLine("LiveLink URL="+url);
Console.ReadLine();
}
}
catch (Exception e)
{
Console.WriteLine("Error="+e.Message);
Console.ReadLine();
}
MachinePerformAction
Thismethodperformsoneofthefollowingmachineactionsasindicatedbytheaction
identifier:
1Poweron.Turnsonamachine.
2Poweroff.Turnsoffamachine.Nothingissaved.
3Suspend.FreezesamachineCPUandstate.
4Resume.Resumesasuspendedmachine.