4.0

Table Of Contents
VMware, Inc. 35
Chapter 4 Lab Manager API Method Reference
C# Sample Code
try
{
LabManagerSoap.LabManagerSOAPinterface binding = new
LabManagerSoap.LabManagerSOAPinterface();
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
binding.AuthenticationHeaderValue.organizationname;
ServicePointManager.CertificatePolicy = new CertificateAccepter();
string workspaceName = binding.GetCurrentWorkspaceName();
Console.WriteLine("Current workspace I am logged in: " + workspaceName);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
GetMachine
ThiscalltakesthenumericidentifierofamachineandreturnsitscorrespondingMachineobject.
Syntax
Machine mach = GetMachine(10);
Arguments
Response
C# Sample Code
try
{
LabManagerSoap.LabManagerSOAPinterface binding = new
LabManagerSoap.LabManagerSOAPinterface();
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
binding.AuthenticationHeaderValue.organizationname = "MyOrg";
binding.AuthenticationHeaderValue.workspacename = "MyWorkspace";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
LabManagerSoap.Machine machine = binding.GetMachine(35);
//** Write to the console all machines in configuration.
Console.WriteLine("Machine = " + machine.name);
Field Data Type Description
machineID int Machineidentifier.
Field Data Type Description
machine Machine Machineobjectmatchingthemachine
identifier.