Build JAX-WS Sample
Code
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.
- Set theJAVAHOMEenvironment variable to the base directory of your installed JDK.On Linux this could be/usr/lib/jvm/java-7-openjdk-i386for example.On Windows this could beC:\Program Files\Java\jdk1.7.0_65for example.
- Change directory tosdk/samples/JAXWSand run thebuild.shscript (or on Windows, thebuild.batfile) to generate theSite Recovery ManagerAPI Java stubs from thesrm-Service.wsdldefinitions, 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 thesrm-Service.wsdlSRM 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 thesrm.jarfile.
To compile Java code that imports the generated stubs and uses thesrm.jarbuilt by thebuild.shscript, the WSDL file must be in the same location that was specified by the-wsdlLocationcommand line option. To establish this location, the build script modifies theSrmServiceclass to reference the WSDL location inside the JAR file. Then you just need to add thesrm.jarfile to your class path.