About The Java Jax-Ws Samples - VMware VC-SRM4-A - vCenter Site Recovery Manager Developer's Manual

Site recovery manager api
Table of Contents

Advertisement

Site Recovery Manager API Developer's Guide
4
Run the sample code at the command prompt.
To run the C# sample code
1
After you generate the sample program, you can run it as follows:
RecoveryPlan --url <webserviceurl> --username <user> --password <passwd> --planname <plan>
The RecoveryPlan program lists all recovery plans and optionally gets the state for the plan specified 
after the --planname option.
2
You can remove build files by running the clean.bat batch script. 

About the Java JAX-WS Samples

This section describes how to build and run the sample code that uses the JAX‐WS bindings for the SRM API. 
Sample code has been developed to work with the JAX‐WS framework that is bundled with the JDK 1.6. Source 
code is located in a sub‐directory of sdk\samples\JAXWS\com\vmware as extracted from the ZIP archive. 
The JAX‐WS framework is included with recent JDK releases.
To build the JAX-WS sample code
1
Set your JAVAHOME environment variable to the base directory of an installed JDK 1.6 update 22 or later, 
C:\Program Files\Java\jdk1.6.0_29 for example. 
2
Change directory to sdk\samples\JAXWS and run the build.bat script to generate the SRM API Java 
stubs from the srm-Service.wsdl definitions, generate Java stubs, and compile the sample code. 
WSDL file dependency: JAX‐WS requires a WSDL file for stub generation and compilation. To manage 
this dependency, the build script performs the following operations:
It calls the wsimport JDK tool to generate Java stubs from the srm-Service.wsdl SRM WSDL file. 
It specifies the wsimport -wsdlLocation command line option to identify the WSDL file location.
It copies the WSDL file and related schema files into the srm.jar file.
To compile Java code that imports the generated stubs and uses the srm.jar built by the build.bat 
script, the WSDL file must be in the same location that was specified by the -wsdlLocation command 
line option. To establish this location, the build script modifies the SrmService class to reference the WSDL 
location inside the JAR file. You only need to add the srm.jar file to your class path.
To run the JAX-WS sample code
1
Change directory to sdk\samples\JAXWS (the JAR files are located) and set CLASSPATH. For example: 
set CLASSPATH=C:\sdk\samples\JAXWS\srm.jar;C:\sdk\samples\JAXWS\samples.jar;%CLASSPATH%
Sometimes %CLASSPATH% has already been set to include %JAVAHOME%\lib or elsewhere.
2
Run the program. Any sample program should print its usage summary if you do not specify an options, 
or if you specify --help on the command line.
java com\vmware\recovery\RecoveryPlan --help
or
run.bat com.vmware.recovery.RecoveryPlan --help
3
The run.bat script accepts arguments to run a specified sample program and uses the VMKEYSTORE 
environment variable to securely access an SRM server. 
For more information about VMKEYSTORE, see "SSL Certificates" on page 33.
To clean up JAX-WS sample code
1
Change directory to sdk\samples\JAXWS where the build.bat script is located.
2
Run the clean.bat script. 
16
VMware, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vcenter site recovery manager 5.0

Table of Contents