2.4

Table Of Contents
VMware® Lab Manager SOAP API Guide
18 VMware, Inc.
AnalertfromtheVisualStudioenvironmentmightappear.ClickYestoproceed.
TheMicrosoftVisualStudioenvironmentconnectstotheWebserviceendpoint
anddisplaystheoperationsdescribedintheLabManagerWebserviceWSDL.
7 SelectthetextintheWebreferencenametextboxandrenametheWebreference
toLabManagerSoap,thenamespaceusedforthisWebreference.
“LabManagerSoap”isoneword,withoutspaces.
8ClickAddReferencetocompletetheprocess.
Acertificatewarningmessagemightappear.ClickYes.
9ClickYesagaintoproceed.
Formoreinformation,seethe“A d d i n g andRemovingWebReferences”topicin
theVisualStudiodocumentation.
VisualStudio
retrievestheservicedescriptionandgeneratesaproxyclass
(LabManagerSoap)thatservesasaninterfacetotheLabManagerWebservicefrom
yourapplication.Attheendoftheprocess,theclassgetsaddedtotheWebReferences
folderoftheproject.(ClickSolutionExplorertoseeLabManagerSoaplistedinthe
Web
Referencesfolder .)
Withthisbasicsetuptaskcompleted,youcanbuildclientapplicationsthatusetheLab
ManagerWebServiceSOAPAPI.ThefastestwaytobecomefamiliarwiththeAPIisby
walkingthroughthecodesamplelistedinthenextsection.
Simple and Advanced Code Samples
Thissectioncontainstwocodesamples—onesimpleandonemorecomplex—written
inC#usingtheMicrosoftVisualStudio2003IDE.
AssumingthatyouhaveaLabManagerinstancerunning,yourprogramming
environmentissetup,andyouhavetheappropriatepermissionsontheLabManager
server(see“Requirements”onpage 16),you
cantestbasicAPIprogramming
connectivitybetweenyourdevelopmentworkstationandyourLabManagerWeb
servicebyusingthe“SimpleC#ConsoleApplication.”Copythecodelistingdisplayed
inthenextsection,andpasteitintoyourMicrosoftVisualStudio2003environment.
N
OTE VMwareassumesyouarefamiliarwithbasicprogrammingconceptsand
alreadyhaveaprogrammingdev elopmentenvironmentsetuponyour
computer.IfyouareusingaprogramminglanguageotherthanC#andaWeb
servicesdevelopmentenvironmentotherthanMicrosoftVisualStudio2003,
seetheappropriatedocumentationformoreinformation.