Use the Included Build Scripts in the Web Services SDK

If you modify the sample files, or need to rebuild them for any reason, you can use the build.bat or build.sh script included with the SDK. These scripts performs all necessary tasks to build the SDK files.

This task shows how to use the build scripts included with the SDK.

Prerequisites

You must install the JDK and set the JAVAHOME environment variable.

Procedure

  1. Open a command prompt.
  2. Navigate to the subdirectory containing the build.bat and build.sh files.
    cd %WS_SDK_HOME%\java\JAXWS\
  3. Run the build.bat (or build.sh) script by entering its name at the command prompt.
    build

    The console displays output, starting with Generating stubs from wsdl. In a few minutes, the process finishes. The word Done appears at the command prompt, as shown in the following example. The Generating stubs from wsdl message appears twice, because this build file generates client stubs using both sets of WSDL declarations, found in the \vim and \vim25 subdirectories.

    Successful Stub Generation and Compilation Using the build.bat Script

    Generating stubs from wsdl
    Compiling stubs.
    ...
    Done.
    C:\devprojects\visdk21\SDK\vsphere-ws\java\JAXWS>

Results

When the process finishes, the appropriate sample .jar files show the current date and time.

To compile without re-generating the stubs from the WSDL, use the -w flag with the build script, as follows:

build -w

You can run any of the sample applications by following the instructions in Running the Web Services SDK SimpleClient Sample Application to Validate Setup