The sample program that uses JAX‐WS bindings for the Site Recovery Manager API was developed to work with the JAX‐WS framework that is bundled with the JDK 1.6 and later.
Procedure
- Set the
JAVAHOME
environment variable to the base directory of your installed JDK.On Linux this could be /usr/lib/jvm/java-7-openjdk-i386 for example.On Windows this could be C:\Program Files\Java\jdk1.7.0_65 for example. - Change directory to sdk/samples/JAXWS and run the build.sh script (or on Windows, the build.bat file) to generate the Site Recovery Manager API Java stubs from the srm-Service.wsdl definitions, generate the Java stubs, and compile the sample Java code into a class file.
Note the 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.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 SrmService class to reference the WSDL location inside the JAR file. Then you just need to add the srm.jar file to your class path.