Build JAX-WS Sample Code
The build scripts (build.bat or build.sh) generate Site Recovery Manager Appliance Management API Java stubs from the Site Recovery Manager Appliance Management API WSDL, compile the generated stubs, and compile the sample programs.
Procedure
- Set the JAVAHOME environment
variable to the base directory of your installed JDK 1.8.For example,
- On Linux, this can be /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64, or / , depending on your java location
- On Windows, this can be C:\Program Files\Java\jdk1.8.0_202
- Change directory to
sdk/samples/drconfig/JAXWS and run the build.sh
script (or on Windows, the build.bat file) to generate the Site Recovery
Manager Appliance Management API Java stubs from the drconfig-Service.wsdl
definitions, generate the Java stubs, and compile the sample Java code into
class files, from which jars will be created (drconfig.jar, samples.jar and
vim25.jar).Note the WSDL file dependency: JAX‐WS requires a WSDL file for the stub generation and compilation. To manage this dependency, the build script performs the following operations:
- Calls the wsimport JDK tool to generate the Site Recovery Manager Appliance Management Java stubs from the Site Recovery Manager Appliance Management API WSDL file (drconfig-service.wsdl).
- Specifies the wsimport -wsdlLocation command-line option to identify the WSDL file location.
- Copies the WSDL file and related schema files into the drconfig.jar file.
The script compiles the Sample Java code, and imports the generated stubs. It uses the drconfig.jar built by the build.sh 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 DrConfigService class to reference the WSDL location inside the JAR file. The Sample.jar will be modified to have the class path reference to the dependant JAR files.