3.0

Table Of Contents
VMware, Inc. 19
Chapter 2 Getting Started with the Lab Manager SOAP API
public class CertificateAccepter : System.Net.ICertificatePolicy
{
public CertificateAccepter() {}
public bool CheckValidationResult(
System.Net.ServicePoint servicePoint,
System.Security.Cryptography.X509Certificates.X509Certificate
cert,
System.Net.WebRequest webRequest, int iProblem)
{
return true;
}
}
} //** end Namespace}
Advanced C# Sample: Integrating Lab Manager and Quality
Center
TheC#.NETexampleinthissectionisamoreextensive—andmorepractical—example
ofusingtheLab ManagerSOAPAPI.Thissampleshowstheintegrationofthe
Lab ManagerSOAPAPIcallswithMercuryInteractiveCorporationQualityCenter
product.Thesamplecodeperformsthesetasks:
MakesLab ManagerAPI(Lab ManagerSOAPAPI)callstocheckouta
configurationfromtheLibraryanddeployit.
RunsaseriesofpredefinedtestsonthedeployedconfigurationusingMercury
QualityCenter.
MakesLab ManagerSOAPAPIcallstocapturetheconfigurationandundeployit
fromtheWorkspace.
Thesetasksareaccomplishedinthesamplecodeusingthesethreemethods:
CheckoutDeployConfiguration()methodObtainstheconfigurationfromthe
LibraryanddeploysittotheLab ManagerWorkspace.
RunQCTestset()methodRunsaseriesofpredefinedMercuryInteractiveQuality
Centertests.(Formoreinformationaboutthepredefinedtests,seetheMercury
InteractiveQualityCenterdocumentation.)
CaptureUndeployConfiguration()methodUndeploystheconfigurationand
capturesittotheLibrary.
Inaddition,theGetLMAPI()methodcreatesanewbindingtotheLab ManagerAPI
andsetsupauthenticationparameters.Thismethodconfiguresthecertificatepolicyfor
the.NETservicepointmanagertoacceptanycertificateprogrammatically.
GetLMAPI()returnsaninstance
oftheLab Managerbinding.