6.0
Table Of Contents
- vSphere Web Services SDK Developer’s Setup Guide
- Contents
- About the vSphere Web Services SDK
- Knowledge Required for Using the vSphere Web Services SDK
- Programming Languages Supported by the vSphere Web Services SDK
- Types of Applications That You Can Build Using This SDK
- Downloading the vSphere Web Services SDK
- vSphere Web Services SDK Package Contents
- SDK Versions and VMware vSphere Product Compatibility
- Setting Up for Java Development
- Setting Up for Microsoft C# Development
- vSphere Server Certificates
- Scripting the C# DLL Build
- Index
VMware, Inc. 15
Chapter 2 Setting Up for Java Development
3Run the build.bat (or build.sh) script by entering its name at the command prompt.
build
The console displays output, starting with Generating stubs from wsdl. In a few minutes, the process
finishes. The word Done appears at the command prompt, as shown in Example 2-1. The Generating
stubs from wsdl message appears twice, because this build file generates client stubs using both sets of
WSDL declarations, found in the \vim and \vim25 subdirectories.
Example 2-1. Successful Stub Generation and Compilation Using the build.bat Script
Generating stubs from wsdl
Compiling stubs.
...
Done.
C:\devprojects\visdk21\SDK\vsphere-ws\java\JAX-WS>
When the process finishes, the appropriate sample .jar files show the current date and time.
To compile without re-generating the stubs from the WSDL, use the -w flag with the build script, as follows:
build -w
You can run any of the sample applications by following the instructions in “Running the SimpleClient Sample
Application to Validate Setup.”
Running the SimpleClient Sample Application to Validate Setup
You can test your setup and connectivity by running one of the sample applications, such as SimpleClient.
SimpleClient is a Java class that connects to the server and obtains a listing of the top-level inventory entities,
their properties, and references. You can run any of the samples using the run.bat (or run.sh) script.
If you are using stubs generated by JAX-WS, these scripts require the JAVAHOME environment variable to be
set.
Run a Sample Application Using the Provided Scripts
You can use the run.bat or run.sh script to run any of the Java samples. The SimpleClient sample is a good
choice to verify that your installation is correct. The path to the source file for SimpleClient is:
%WS_SDK_HOME%\java\JAXWS\samples\com\vmware\general\SimpleClient.java
When you run the script, specify the Java class for the sample application along with the --url, --username,
and --password switches on the command line. Include the complete package name in the Java class
specification. The following statement shows the general format for using the run.bat script to run the
SimpleClient sample application from the Java samples subdirectory for JAX-WS:
run.bat com.vmware.samples.general.SimpleClient --url https://yourFQDNservername/sdk
--username username --password password [--ignorecert ignorecert]
Example 2-2 shows sample output from the SimpleClient sample program.