VS5 WSSDK Developer Setup Guide
VS5 WSSDK Developer Setup Guide
This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
EN-000670-01
You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: [email protected]
Copyright 20072011 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
Contents
AboutThisBook
1 AboutthevSphereWebServicesSDK 7
KnowledgeRequiredforUsingthevSphereWebServicesSDK 7 ProgrammingLanguagesSupportedbythevSphereWebServicesSDK TypesofApplicationsThatYouCanBuildUsingThisSDK 8 vSphereWebServicesSDKPackageContents 9 SDKVersionsandVMwarevSphereProductCompatibility 10 8
2 SettingUpforJavaDevelopment 11
Requirements 11 SetupInstructionsforJavaDevelopment 11 SettingUpforDevelopmentUsingJAXWS 12 SettingUpforDevelopmentUsingApacheAxis 12 SettingEnvironmentVariablesforAxisDevelopment 13 BatchFilesandShellScriptsforBuildingandRunningSamples 15 ImportingServerCertificatesintotheJavaKeystore 15 GeneratingStubsandCompilingClasses 16 PrecompiledJAXWSSamples 17 PrecompiledAxisSamples 17 UsingtheIncludedBuildScripts 17 RunningtheSimpleClientSampleApplicationtoValidateSetup 18 RunningaSampleApplicationUsingtheProvidedScripts 18 TroubleshootingSetupIssues 20
3 SettingUpforMicrosoftC#Development 21
Requirements 21 EnvironmentVariableSettings 21 SetupInstructionsforC#Development 22 BuildingtheC#Samples 22 BuildingforaChosenVersionofVisualStudio 22 IteratingtheBuildforBothVimandVim25Namespaces 23 RunningtheMicrosoft.NET(C#)VersionofSimpleClient 24 TroubleshootingSetupIssues 25
Appendix:vSphereServerCertificates
27
Index 33
VMware, Inc.
VMware, Inc.
Revision History
Thisguideisrevisedwitheachreleaseoftheproductorwhennecessary.Arevisedversioncancontainminor ormajorchanges.Table 1summarizesthesignificantchangesineachversionofthisguide. Table 1. Revision History
Revision 17Nov2011 24Aug2011 13Jul2010 07May2009 Description CorrectedsetupinstructionsforC#stubs. UpdatedforvSphere5.0(includedinformationonusingJAXWSbindings). MinorupdatesforvSphere4.1(newWSDLfileconfiguration,examplesyntax). RevisedreleaseoftheDevelopersSetupGuideforvSphereWebServicesSDK4.0.Servercertificatesetup informationislocatedinthereferencesection.ChangeddirectorynameforWSDLFILEenvironment variable. InitialreleaseofDevelopersSetupGuideforVMwareInfrastructureSDK2.5.
29Nov2007
Intended Audience
ThisbookisintendedforanyonewhowantstodevelopapplicationsusingtheVMwarevSphereWebServices SDK.vSphereWebServicesSDKdeveloperstypicallyincludesoftwaredeveloperscreatingclientapplications usingJavaorC#(intheMicrosoft.NETenvironment)targetingVMwarevSphere.
Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Sendyourfeedbackto [email protected].
VMware, Inc.
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto http://www.vmware.com/support/services.
VMware, Inc.
TheVMwarevSphereWebServicesSDKincludesallthecomponentsnecessarytoworkwiththe VMwarevSphereAPI,includingWSDLfiles,samplecode,andvariouslibraries.The vSphereWebServicesSDKfacilitatesdevelopmentofclientapplicationsthattargettheVMwarevSphereAPI. WiththevSphereWebServicesSDK,developerscancreateclientapplicationstomanage,monitor,and maintainVMwarevSpherecomponents,asdeployedonESX,ESXi,andVMwarevCenterServersystems. ThisDevelopersSetupGuideprovidesinformationaboutsettingupthedevelopmentenvironmentforusing JavaandMicrosoft.NET(usingtheC#programminglanguage)tocreatenewapplications,andinformation aboutrunningthesampleapplicationsincludedwiththevSphereWebServicesSDK. Thischapterincludesthesetopics: KnowledgeRequiredforUsingthevSphereWebServicesSDKonpage 7 ProgrammingLanguagesSupportedbythevSphereWebServicesSDKonpage 8 TypesofApplicationsThatYouCanBuildUsingThisSDKonpage 8 vSphereWebServicesSDKPackageContentsonpage 9 SDKVersionsandVMwarevSphereProductCompatibilityonpage 10
VMware, Inc.
VMware, Inc.
VMware, Inc.
10
VMware, Inc.
Requirements
DevelopingJavaWebservicesclientapplicationsusingtheVMwarevSphereWebServicesSDKrequiresthe JavaSDKandaJavaWebservicesdevelopmenttoolset.VMwarerecommendsusingJava2,StandardEdition, version6.0(J2SE1.6.x),specificallyJDK1.6b22orlater. TheJavaWebservicesdevelopmenttoolsetmustbeaSOAP(SimpleObjectAccessProtocol)implementation thatcanbedeployedtoaTomcatserver.VMwarerecommendsthatyouuseoneofthefollowingclientside webserviceslibraries: JavaAPIforXMLWebServices(JAXWS)version2.1.TheJAXWS2.1librariesareincludedwiththe JDK1.6. ApacheAxis1.4.AxisisanopensourceprojectoftheApacheWebservicesproject.YoucanobtainAxis fromtheApacheWebservicesprojectsiteathttp://ws.apache.org/axis/. NOTETheApacheAxis1.4librarieshaveaknownissuethatpreventsthemfromworkingwithJ2SE6.0 (JDK1.6).IfyouusetheAxis1.4libraries,youmustuseJ2SE5.0(JDK1.5_0_08).Supportforthe ApacheAxis1.4bindingsisdeprecatedinvSphere5.0. Youcanuseotherclientsidetoolsandlibraries,suchasIBMWebSphereandseveralopensource implementations,withthevSphereWebServicesSDK.However,onlytheJAXWSandAxisclientlibraries weretestedwiththisDevelopersSetupGuide. Thesamplesarchive(samples.jar)includesallvSphereWebServicesSDKsamples.Thesamplesinclude clientsideproxycode(stubclasses)generatedusingboththeJAXWSandApacheAxis1.4libraries.Samples usingJAXWSweregeneratedusingJDK1.6b22.SamplesgeneratedusingApacheAxis1.4weregenerated usingJDK1.5_0_08.
VMware, Inc.
11
2 3 4
ImportservercertificatesandusetheJavakeytoolutilitytocreateavmware.keystore.SeeImporting ServerCertificatesintotheJavaKeystoreonpage 15fordetails.Optionally,youcanignore servercertificateverificationforanyofthesampleJavaapplicationsbypassingthe--ignorecert argumentatruntime. CreatetheJAVAHOMEenvironmentvariable.TheJAVAHOMEenvironmentvariablemustbesettothe rootpathoftheJavaRuntimeEnvironment(JRE),suchasC:\jre1.6_0\jre. Addtheprecompiledsamplefiles(vim25.jarandsamples.jar)toyoursystemCLASSPATH environmentvariable.Asanalternative,youcanusetherun.batscript.Tousetherun.batscript,the JAVAHOMEenvironmentvariablemustbedefined. IfyouarenotusingJDK1.6b22,youmustusethebuild.bat(orbuild.sh,onLinux)togeneratestubsand compilethesamplefiles(vim25.jarandsamples.jar).Thebuildscriptsperformallnecessarytasksfor you,includingsettingtheCLASSPATHandPATHenvironmentvariables.SeeGeneratingStubsand CompilingClassesonpage 16fordetails.
6 7
12
VMware, Inc.
To set up a development workstation to use Java and Apache Axis 1 Createdirectoriesforeachofthecomponentsthatyouwanttoinstall(assumingthatneitherJDKnorAxis clientisinstalled). Donotusespacesinthedirectorynames,toavoidissueswithsomeoftheincludedSDKbatchandscript files.Table 21listssomerecommendednamingconventions. Table 2-1. Recommended Directory Structures
Windows SDK Apache Axis Java 2, Standard Edition (J2SE) c:\devprojects\visdk21 c:\apache\axis c:\java\jdk1.5.0_nn c:\java\jre1.5.0_nn Linux ~\apps\visdk ~\apps\apache\axis ~\apps\java\jdk1.5.0_nn ~\apps\java\jre1.5.0_nn
InstalltheJava2Platform,StandardEdition(J2SE)5.0.VMwarerecommendsusingJDK1.5_0_08dueto improvedperformance(forJavasockets).YoucanobtaintheJ2SEfrom http://java.sun.com/javase/downloads/previous.jsp. ObtaintheApacheAxis1.4clientsideWebserviceslibrariesfromtheApacheWebservicesWebsiteat http://ws.apache.org/axis/java/releases.html. ObtaintheVMwarevSphereWebServicesSDKpackagefromVMwareWebsite http://www.vmware.com/download/sdk/. Unpackthevariouscomponentsintosubdirectoriescreatedinstep1above,usingtheprovidedinstaller ifappropriate.TheJ2SEusesaninstallationwizard.TheAxiszipfileandtheSDKunpackintothe directoryyouspecify. UnpackwithUsefoldernamesselected,tomaintaintheorganizationalstructure. OnUNIXdevelopmentsystems,usetheunzipcommandwiththeamodifier,toensureproper lineendingsintheshellscripts.Forexample:
unzip -a VMware-vSphere-WS-SDK-4.1.0-251329.zip
3 4 5
6 7 8
ImportservercertificatesandusetheJavakeytoolutilitytocreateavmware.keystore.SeeImporting ServerCertificatesintotheJavaKeystoreonpage 15fordetails. (Optional)ToignoreservercertificateverificationforanyofthesampleJavaapplications,youcanpass the--ignorecert argumentatruntimeinsteadofimportingservercertificates. ConfigureenvironmentsettingsasdetailedinSettingEnvironmentVariablesforAxisDevelopmenton page 13.TorunanyoftheJavasampleapplicationsusingtheprovidedrunscript(run.bat,run.sh),you mustsetonlyAXISHOME,JAVAHOME,VMKEYSTORE,andWBEMHOME. Usethebuild.bat(orbuild.sh,onLinux)togeneratestubsandcompileintovim.jar,vim25.jar, apputils.jar,andsamples.jar.Thebuildscriptsperformallnecessarytasksforyou,includingsetting theCLASSPATHandPATH.SeeGeneratingStubsandCompilingClassesonpage 16fordetails. NOTEIfyouareusingAxis1.4andJDK1.5,youdonotneedtousethebuildscript.Instead,addvim.jar, vim25.jar,apputils.jar,andsamples.jartoyoursystemCLASSPATH.Alternatively,setthe AXISHOME,JAVAHOME,VMKEYSTORE,andWBEMHOMEandusetherun.bat(orrun.sh).
10
Ifyoudonotwanttousethescripts,youmustsetCLASSPATHandPATHenvironmentvariablessothatthey includetheAxislibrariesandtheJ2SElibraries.Ifthesevariablesdonotalreadyexistonyourdevelopment workstation,youmustcreatethem.Table 22listsenvironmentvariablenames,directories,andfilenamesthat youmustspecificallyset.TheSDKHOMEenvironmentvariableisforconvenience. To set environment variables required by the build and run scripts 1 CreateenvironmentvariablesforAXISHOME,JAVAHOME,SDKHOME,VMKEYSTORE,and WBEMHOME,asdefinedinTable 22. ForMicrosoftWindowsdevelopmentworkstations,youmustsetSystem(ratherthanUser) environmentvariables. ForLinuxdevelopmentworkstations,youmustexportthevariablesinyouruserprofile. 2 3 TotheSystemCLASSPATH,addthecompletepathtoallAxisclientsidelibraryJARsandadditional librariesprovidedwiththeSDKspecifiedinTable 22. TotheSystemPATHenvironmentvariable,addthepathtotheAxisandJavaruntimebinaries,as specifiedinTable 22.
Table 2-2. Environment Variable Names and Required JAR and Other Files
Variable Name AXISHOME CLASSPATH Setting must Include... CompletepathtotheApacheAxisinstallationtopleveldirectory.Forexample: C:\apache\axis1.4 CompletepathstospecificJARfilesandotherlibrariesrequiredbyJavaandAxistools.Addthese specificJARfilestotheCLASSPATH(assumesthatyouhavesetupAXISHOME,JAVAHOME, andSDKHOME). %AXISHOME%\lib\axis.jar %AXISHOME%\lib\axis-ant.jar %AXISHOME%\lib\commons-discovery-0.2.jar %AXISHOME%\lib\commons-logging-1.0.4.jar %AXISHOME%\lib\jaxrpc.jar %AXISHOME%\lib\log4j-1.2.8.jar %AXISHOME%\lib\saaj.jar %AXISHOME%\lib\wsdl4j-1.5.1.jar %JAVAHOME%\lib\tools.jar %SDKHOME%\samples\Axis\java\vim.jar %SDKHOME%\samples\Axis\java\vim25.jar %SDKHOME%\samples\Axis\java\apputils.jar %SDKHOME%\samples\Axis\java\samples.jar %SDKHOME%\samples\Axis\java\lib\activation.jar %SDKHOME%\samples\Axis\java\lib\mailapi.jar %SDKHOME%\samples\Axis\java\lib\wbem.jar JAVAHOME PATH PathtotheJavaruntime(JRE)directory.Forexample: C:\jre1.5_0_08\jre AddthepathtotheJavaandtheAxisbinaryclienttoolstothesystempath.Assumingyousetup theAXISHOMEandJAVAHOMEvariables,youmustadd: %AXISHOME%\bin %JAVAHOME%\bin SDKHOME PaththetopleveldirectoryoftheunpackedSDKdownload.Forexample: C:\devprojects\visdk21\SDK\vsphere-ws\
14
VMware, Inc.
Table 2-2. Environment Variable Names and Required JAR and Other Files
Variable Name VMKEYSTORE Setting must Include... PathtoJavakeystore.TheVMKEYSTOREenvironmentvariableisusedbytherun.batand run.shbatchfiles.Samplepaths: VMKEYSTORE=C:\VMware-Certs\vmware.keystore[Windows] VMKEYSTORE=/root/vmware-certs/vmware.keystore[Linux] IfyouusetheignorecertargumenttorunanyJavasamples(usingtherun.bat orrun.sh script),youmuststillsettheVMKEYSTOREenvironmentvariable.Settoanylocation(youdo notneedtoimportthecertificateorcreatetheactualkeystore,though,ifyouusetheignorecert argument). WBEMHOME PathtotheAxisjavadirectory.Therun.shscriptusesthisvariabletoreferencetheWBEM(Web BasedEnterpriseManagement)Javaarchive(wbem.jar). WBEMHOME=%SDKHOME%\java\Axis\
Batch Files and Shell Scripts for Building and Running Samples
ThevSphereWebServicesSDKincludesseveralbatchfilesforWindowsandshellscriptsforLinuxthat facilitatebuildingandrunningthesampleapplications. NOTEIfyouareusingtheJAXWS2.1librarieswithJDK1.6b22(ortheAxis1.4librarieswithJDK1.5_0_08), youdonotneedtorebuildthesamples. Someofthebatchfilesareusedbyotherbatchfiles.Forexample,build.batcallsthelcp.batand clean.batscripts.Ifyoumodifythebatchfilesforanyreason,beawareofthedependenciesamongthem. Table 2-3. Batch Files and Shell Scripts for Java [..\Axis\java\ Subdirectory]
Filename build.bat build.sh Description Checksforenvironmentvariables(AXISHOME, JAVAHOME,VMKEYSTORE,andWBEMHOME)and setslocalclasspath(bycallinglcp.bat)usingthe variablesasdefined.Thebuild.batfilethencleansup existingJavafiles(bycallingclean.bat). Usage note Usethisscripttogenerateclientstubs andrebuildallsampleapplications. Successfulexecutionofbuild.bat createsthevim.jar,vim25.jar, apputils.jar,andsamples.jarfiles. Usethewflagtorecompilewithout regeneratingstubs. lcp.bat lcp.sh run.bat run.sh Setsthelocalclasspathontheworkstation.Calledby build.batandbyrun.bat. Batchfilethatenablesrunninganyofthesample applications.SetstheJavatrustStorepropertytothelocal truststoreandinvokestheJavaruntimewiththenameof theapplicationpassedasaparameter. Removesanyexistingartifactspriortobuildingthe samples,deletingJavaclassfilesinthesamplespackages andsamples.jarfile.Calledbybuildscript. Optional.Usetosetlocalclasspath. UsethisscripttorunanyJavasample applications.
clean.bat
Optional.Deletesallgeneratedsource codefiles.
VMware, Inc.
15
To import certificates into a local Java keystore 1 2 OpentheWindowscommandpromptorLinuxshellcommand. CreatethedirectoryfortheJavacertificatestore. Createthedirectoryonly.Theactualkeystorefile,vmware.keystore,iscreatedduringtheprocessof importingthecertificates,insubsequentsteps. Table 2-4. Keystore Path
Operating System Windows Linux Path C:\VMware-Certs\vmware.keystore ~/vmware-certs/vmware.keystore
Navigatetothedirectory.Forexample,onWindowsusethefollowingdirectory:
cd vmware-certs\vmware
UsetheJavakeytoolutilitytoimportacertificate.Thesyntaxisasfollows:
keytool -import -file certificate-filename -alias server-name -keystore vmware.keystore
Forexample:
C:\VMware-Certs>keytool -import -file rui.crt -alias sdkpubs01 -keystore vmware.keystore
Apromptrequestingapasswordforthekeystoreappears:
Enter keystore password:
Createapasswordforthekeystorebyenteringitattheprompt.Thekeystoreutilitydisplaysthecertificate informationattheconsole.Forexample:
Owner: OID.1.2.840.113549.1.9.2="1183400896,564d7761726520496e632e", CN=sdkpubslab-01.vmware.com, [email protected], OU=VMware ESX Server Certificate, O="VMware, Inc.", L=Palo Alto, ST=California, C=US Issuer: OID.1.2.840.113549.1.9.2="1183400896,564d7761726520496e632e", CN=sdkpubslab-01.vmware.com, [email protected], OU=VMware ESX Server Certificate, O="VMware, Inc.", L=Palo Alto, ST=California, C=US Serial number: 0 Valid from: Mon Jul 02 11:28:17 PDT 2007 until: Mon Aug 31 11:28:17 PDT 2026 Certificate fingerprints: MD5: . . .61:35:C0:C4 SHA1: 4C:...78:B2
Attheendofthecertificateinformation,apromptdisplaysarequestforconfirmationthatthecertificate istrusted:
Trust this certificate? [no]:
TypeyesandpressEntertorespondtothepromptandimportthecertificateintothevmware.keystore keystore.Theconsoledisplaysthismessage:
Certificate was added to keystore
Repeatthisprocessforeachtargetserver.
16
VMware, Inc.
ForAxis,thisdirectoryis:
%SDKHOME%\java\Axis\
VMware, Inc.
17
Runthebuild.bat(orbuild.sh)scriptbyenteringitsnameatthecommandprompt.
build
Theconsoledisplaysoutput,startingwithGeneratingstubsfromwsdl.Inafewminutes,theprocess completes.ThewordDoneappearsatthecommandprompt,asshowninExample 21.Thegenerating stubsfromwsdlmessageappearstwice,becausethisbuildfilegeneratesclientstubsusingbothsetsof WSDLdeclarations(foundin\vimand\vim25subdirectories). Example 2-1. Successful Stub Generation and Compilation Using build.bat Script
Generating stubs from wsdl Compiling stubs. ... Done. C:\devprojects\visdk21\SDK\vsphere-ws\java\Axis>
Whentheprocesscompletessuccessfully,theappropriatesample.jarfilesshowthecurrentdateandtime. TocompilewithoutregeneratingthestubsfromtheWSDL,usethewflagwiththebuildscript,asfollows:
build -w
Youcanrunanyofthesampleapplicationsbyfollowingtheinstructionsinthenextsection,Runningthe SimpleClientSampleApplicationtoValidateSetup.
Example 22showssampleoutputfromtheSimpleClientsampleprogram.
18
VMware, Inc.
Example 2-2. Sample Output of a Successful Run of SimpleClient (Precompiled Java Sample)
Object Type : Folder Reference Value : ha-folder-vm Property Name : name Property Value : vm Object Type : HostSystem Reference Value : ha-host Property Name : name Property Value : sdkpubslab-02.eng.vmware.com Object Type : ResourcePool Reference Value : ha-root-pool Property Name : name Property Value : Resources Object Type : Folder Reference Value : ha-folder-host Property Name : name Property Value : host Object Type : ComputeResource Reference Value : ha-compute-res Property Name : name Property Value : sdkpubslab-02.eng.vmware.com Object Type : VirtualMachine Reference Value : 16 Property Name : name Property Value : Windows_2K3_VM ... Object Type : Datacenter Reference Value : ha-datacenter Property Name : name Property Value : ha-datacenter Object Type : Folder Reference Value : ha-folder-root Property Name : name Property Value : ha-folder-root
To run the precompiled SimpleClient from the command prompt 1 2 OpenaWindowscommandpromptorshellpromptonLinux. NavigatetotheJavasamplessubdirectory.ForJAXWSsamples,thissubdirectoryis:
cd %SDKHOME%\java\JAXWS\samples
ForAxissamples,thissubdirectoryis:
cd %SDKHOME%\java\Axis\samples
InvoketheJavaruntime,providingthefullpackagenameoftheSimpleClient,serverURN,credentials, andJavakeyStorelocation(orthe--ignorecertargument).Thecompletesyntaxisasfollows:
java -Djavax.net.ssl.trustStore=keystore-path-or-%KEYSTORE%-environment-variable package-hierarchy-classname --url server-url --username username --password password [--ignorecert ignorecert]
Forexample:
java -Djavax.net.ssl.trustStore=%VMKEYSTORE% com.vmware.samples.general.SimpleClient --url https://example.com/sdk --username pubs --password *** --ignorecert ignorecert
NOTEIferrormessagesareraisedduetosystemheaporothermemoryissues,youcangivetheJavaVM morememory,asfollows:
java -Djavax.net.ssl.trustStore=%VMKEYSTORE% -Xms512M -Xmx1024M com.vmware.samples.general.SimpleClient https://sdkpubslab-02.eng.vmware.com/sdk --username username --password password --ignorecert ignorecert
VMware, Inc.
19
20
VMware, Inc.
Requirements
ThevSphereWebServicesSDKincludesC#(.cs)sourcefilesandMicrosoftVisualStudioprojectfiles (solutions,or.sln)forMicrosoftVisualStudio.WebservicesclientapplicationdevelopmentforC#requires: DevelopmentenvironmentforC#,suchasMicrosoftVisualC#orMicrosoftVisualStudio. Microsoft.NETFramework,whichisincludedwithMicrosoftVisualStudio. Microsoft.NETFrameworkSoftwareDevelopmentKit.Youmustuseaversionofthe.NETSDKthat includesthecommandlineC#compiler(csc.exe).
VMware, Inc.
21
To set environment variables required by the build script 1 2 CreatetheenvironmentvariableWSDLFILE,asdefinedinTable 31.SetSystemratherthanUser environmentvariables. IfyourMicrosoftdevelopmentand.NETsoftwarehasnotbeeninstalledusingdefaultpaths,createand settheVSINSTALLDIRenvironmentvariableasdefinedinTable 31.
Toensurethatallpathstoalltools(wsdl.exe,csc.exe)aresetcorrectly,executethecommandscriptfrom theMicrosoft.NETSDKcommandprompt,whichisavailablefromthe.NETSDKmenu.
22
VMware, Inc.
GeneratetheVimService.csfilefromtheWSDL,usingwsdl.exe:
wsdl.exe /n:VimyyApi vim.wsdl vimService.wsdl
Thiscommandgeneratesaserializerassembly(aDLL). 5 UsethesgentooltopregenerateandcompiletheXMLserializers.
sgen /p VimyyService20xx.dll
Replaceitwith:
// [System.Xml.Serialization.XmlIncludeAttribute
VMware, Inc.
23
Youshouldendupwithsomethinglikethis:
// ... Some code here ... [System.Xml.Serialization.XmlSerializerAssemblyAttribute(AssemblyName = "VimyyService20xx.XmlSerializers")] public partial class VimService : System.Web.Services.Protocols.SoapHttpClientProtocol { // ... More code here.
TheAssemblynameshouldbethenameoftheSerializerDLLgeneratedbythesgentoolinstep5. 8 RegeneratetheVimyyService20xx.dlllibrarywiththefollowingcommand:
csc /t:library /out:VimyyService20xx.dll VimService.cs
EnsureyourapplicationreferencesthenewVimyyService20xx.dlllibrary.
24
VMware, Inc.
Theapplicationconnectstotheserver.ABadServerCertificatemessagedisplays:
ClickYestodismissthismessageandproceedtotheserver.Aftertheclientconnectstotheserver,the outputfromserverdisplaysintheconsole(commandprompt),asshowninExample 31: Example 3-1. Sample Output of a Successful Run of SimpleClient
Object Type : Datacenter Reference Value : ha-datacenter Property Name : name Property Value : ha-datacenter Object Type : Folder Reference Value : ha-folder-root Property Name : name Property Value : ha-folder-root
VMware, Inc.
25
26
VMware, Inc.
VMware, Inc.
27
2 3
4 5 6 7 8 9
28
VMware, Inc.
VMware, Inc.
29
5 6 7 8
To modify the Web proxy service on ESXi to support HTTP BecauseESXihasnoServiceConsole,youcannotusethesameprocessdescribedinTomodifytheWebproxy serviceonESXtosupportHTTPonpage 29.Instead,youmustusetheappropriatevSphereCLIcommand toobtaintheproxy.xmlfilefromtheserver,modifythefiletosupportHTTP,andthenmovethefilebackto theESXisystem.SeethevSphereCLIInstallationandReferenceGuideformoreinformation. To modify the Web proxy service on vCenter Server to support HTTP 1 2 LogintothevCenterServersystemastheWindowsAdministratorofthemachine. Changetothedirectorycontainingtheproxy.xmlfile:
c:\Documents and Settings\AllUsers\Application Data\VMware VirtualCenter
3
30
Useatexteditortoopentheproxy.xmlfile.
VMware, Inc.
4 5 6
VMware, Inc.
31
32
VMware, Inc.
Index
A
Apache Axis, generating stubs 16 API 7 AXISHOME 14
V
VMKEYSTORE 15 VSINSTALLDIR 22 vSphere SDK Package 9 vSphere SDK package, WSDL files 9
C
C# requirements 21 CLASSPATH 14
W
WBEMHOME 15 WSDL (web services description language), defined 7 WSDL files 9 WSDLFILE 22
E
environment variables C# 22 Java 13, 14, 15 error message, not implemented 10
H
http protocol, configuring 29
J
JAVAHOME 14
M
Microsoft .NET requirements 21 Microsoft Visual Studio 2005 22
N
non-SSL, configuring server for HTTP 29
O
operations 7
P
PATH 14
R
Requirements C# development 21 Java development 11
S
samples.jar 9 SDKHOME 14 SOAP toolkits 8 SOAP, defined 7
T
technical support resources 6
VMware, Inc.
33
34
VMware, Inc.