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: Sample Output of a Successful Run of SimpleClient, Using Precompiled Java Sample shows sample output from the SimpleClient sample program.
Example: Sample Output of a Successful Run of SimpleClient, Using 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
cd %WS_SDK_HOME%\java\JAXWS\samples
3
Invoke the Java runtime, providing the full package name of the SimpleClient, server URN, credentials, and Java keyStore location, or the --ignorecert argument. The complete syntax is as follows:
java -Djavax.net.ssl.trustStore=keystore-path-or-%KEYSTORE%-environment-variable package-hierarchy-classname --url server-url --username username
--password
password [--ignorecert ignorecert]
For example:
java -Djavax.net.ssl.trustStore=%VMKEYSTORE% com.vmware.general.SimpleClient
--url https://example.com/sdk --username pubs --password ***
--ignorecert ignorecert