Readme for Java Samples
VMware vSphere Web Services SDK Readme
Readme for C# (.NET) Samples
|
This document includes these topics:
This document includes summary information only. See the Developers Setup Guide (Chapter 2, Setting Up for Java Development) for complete information.
|
| Note: Information in this document may not be current. For up-to-date information, check these VMware Web sites: |
|
|
|
Building the Samples
The vSphere Web Services SDK includes several scripts (batch files for Windows environments; shell scripts for Linux environments) to facilitate building and running the samples. These batch files require setting several environment variables. If your development workstation is setup using Java JDK 1.5 (or later) and Axis 1.4, you can use the sample applications, as is, without re-generating client-side proxy code and re-compiling.To run any samples, simply use the run.bat (or run.sh).
To use the build script (build.bat for Windows; build.sh for Linux)
- Set the environment variables as shown in the table.
|
Environmentvariable |
Description and usage notes |
Example setting
|
|
AXISHOME | Complete path to the Apache Axis installation top-level directory. Must be set prior to using build.bat, build.sh, run.bat, and run.sh scripts. | C:\apache\axis1.4 |
|
JAVAHOME | Path to the binary directory for the Java JDK. |
C:\jdk1.5_0_08
|
|
WBEMHOME | Path to the WBEM (Web Based Enterprise Management) Java archive.
|
SDK\samples\Axis\java
|
- Open the Windows command prompt (or Linux shell).
- Navigate to the SDK\samples\Axis\java sub-directory.
- Enter build at the command prompt. To rebuild without re-generating stubs, pass -w to the build script, on the command line. Here are some examples:
c:>build.bat [Windows]
% build.sh [Linux]
build -w [Windows]
build.sh -w [Linux]
See the Developers Setup Guide (Chapter 2, Setting Up for Java Development) for complete information.
Running the Samples
The SDK includes scripts (run.bat for Windows; run.sh for Linux) to simplify running the Java samples.
To use the run script (run.bat for Windows; run.sh for Linux)
- Set the environment variables listed in the table:
|
Environmentvariable |
Description and usage notes |
Example setting
|
|
AXISHOME | Complete path to the Apache Axis installation top-level directory. Must be set prior to using build.bat, build.sh, run.bat, and run.sh scripts. | C:\apache\axis1.4 |
|
JAVAHOME | Path to the binary root directory for the Java JDK or the JRE. |
C:\jdk1.5_0_08
|
|
VMKEYSTORE | Path to Java keystore. The VMKEYSTORE environment variable is used by the run.bat and run.sh scripts. It is required, even if you plan to use the ignorecert argument when running Java applications (using the run script). |
VMKEYSTORE=C:\VMware-Certs\vmware.keystore [Windows]
VMKEYSTORE=/root/vmware-certs/vmware.keystore [Linux]
|
|
WBEMHOME | Path to the WBEM (Web Based Enterprise Management) Java archive.
|
SDK\samples\Axis\java
|
- Open the Windows command prompt (or Linux shell).
- Navigate to the SDK\samples\Axis\java sub-directory.
- Enter run at the command prompt, passing the name of the Java sample and the required command-line arguments. For example:
c:> run.bat com.vmware.vimsample.SampleName <webserviceurl> <username> <password> <Other application-specific parameters> ...
See the Developers Setup Guide (Chapter 2, Setting Up for Java Development) for complete information.
Sample Applications
The SDK package includes generated Javadoc for the sample applications and helper classes, in this path:
%SDKHOME%\SDK\doc\samples\javadoc
If the relative link above does not work, manually navigate to the sub-directory.
The Java sample applications all use the helper classes available in the com.vmware.apputils package. The AppUtils class defines several options that are used by all the samples.
Command-line Options Common to All the Java Samples in the vSphere Web Services SDK Package
|
Option |
Description |
Usage note or example
|
|
--url | Required. Complete URL for the vSphere API Web service for the connection.
| --url http://myesxserverorvcserver/sdk
|
|
--userName | Required. User account with privileges to connect to the host. | --userName sdkuser |
|
--password | Required. Password for the user account. | --password <password> |
| --server | Fully-qualified name of the VMware vSphere server (ESX, ESXi, vCenter, for example) to connect to, such as myserver.mycompany.com. | --server myserver.mycompany.com |
| --portNumber | Server port for the vSphere API Web service. Default is 443 (for HTTPS). | --portNumber 8080 |
|
--protocol | Protocol for the server connection (HTTP, HTTPS; HTTPS is the default). | --protocol http |
|
--servicePath | Service path for the vSphere API Web service, such as /sdk, /sdk/webService | --servicePath /sdk |
|
--sessionFile | File containing a previously saved session cookie, for re-establishing connection to the server. | --sessionFile mysession |
|
--ignorecert | Avoid the SSL server-certificate validation process. | --ignorecert ignorecert |
|
--config | Location of an optional configuration file that contains the required parameters. | --config myconfigfile |
|
--help | Display list of command-line options for the application. | --help |
In addition to the common options listed in the table, specific Java samples may implement specific options, relevant for the application.
To display help text for any application, simply run the application without any parameters. Parameters for sample applications are also available in the Javadoc, and in the listing in the table.
VMware Resources
Copyright © 2009 VMware, Inc. All rights not expressly granted herein
are reserved.
Last updated: 8-Dec-2008 12:30 pm | VMware vSphere Web Services SDK
|