3.0

Table Of Contents
Lab Manager SOAP API Guide
16 VMware, Inc.
VisualStudioretrievestheservicedescriptionandgeneratesaproxyclass
(LabManagerSoap)thatservesasaninterfacetotheLab ManagerWebservicefrom
yourapplication.Attheendoftheprocess,theclassisaddedtotheWebReferences
folderoftheproject.(ClickSolutionExplorertoseeLabManagerSoaplistedin
theWeb
Referencesfolder .)
Withthisbasicsetuptaskcompleted,youcanbuildclientapplicationsthatusethe
Lab ManagerSOAPAPI.ThefastestwaytobecomefamiliarwiththeAPIisby
reviewingthecodesamplelistedin“SimpleandAdvancedCodeSamples”onpage 16.
Simple and Advanced Code Samples
Thissectioncontainstwocodesamples—onesimpleandonemorecomplex—written
inC#usingtheMicrosoftVisualStudio2003IDE.
AssumingthatyouhaveaLab Managerinstancerunning,yourprogramming
environmentissetup,andyouhavetheappropriatepermissionsontheLab Manager
server(see“Requirements”onpage 13),youcantest
basicAPIprogramming
connectivitybetweenyourdevelopmentworkstationandyourLab ManagerWeb
servicebyusingthe“SimpleC#ConsoleApplication.”Copythecodelistingdisplayed
inthenextsection,andpasteitintoyourMicrosoftVisualStudio2003environment.
Thecodeperformsseveralsimpletasks.Thefirsttwotasks(bindingto
theWebservice
andprovidingcredentials)aretypicallyrequiredofanyapplicationthatmakescallsto
aLab ManagerWebservice:
BindstotheLab ManagerSOAPAPI.
SetsuptheusernameandpasswordformakingaSOAPcall.
SetsuptheServicePointManagercertificatepolicytoaccepttheSSLcertificate.You
mustsetupthecertificatepolicytoacceptallcertificatestoconnecttotheAPI.
Makesacalltogetaconfigurationobjectbasedonname.
Displaysallconfigurationfieldsintheconsole.
N
OTEVMwareassumesyouarefamiliarwithbasicprogrammingconceptsand
alreadyhaveaprogrammingdevelopmentenvironmentsetuponyourcomputer.If
youareusingaprogramminglanguageotherthanC#andaWebservicesdevelopment
environmentotherthanMicrosoftVisualStudio2003,seetheappropriate
documentationformoreinformation.