Previous Topic: Implement loginServiceManaged in JavaNext Topic: impersonate


Generate Stub Classes with WSDL2Java

You can generate the stub classes for the CA SDM web services.

To generate stub classes with WSDL2Java

  1. Open a command prompt and navigate to the "<drive>:\program files\CA" directory.

    The directory appears.

  2. Run the dir /x command.

    The short form of the CA SDM directory appears. For example, the short name is "SERVIC~1."

  3. Search for javac.exe on all of the server's local drives. If you locate the file, make note of its location because you will need to reference it in a batch file.

    Note: If you do not locate javac.exe, go to Http://java.sun.com and search for Java J2SE SDK to download. This may require a reboot.

  4. Build a batch file called build_wsdl.bat and place it in the following directory:
    $NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\axis
    
  5. Use the following code for the batch file, updating the bold items as appropriate:
    @echo off
    ::##################################################################
    ::# Simple bat file to Build Unicenter Service Desk Version 11.0 USD Stub classes
    ::# Use it to create the required USD Unicenter Service Desk Version 11.0 Java Web Services classes
    ::#
    ::#  Usage: build_wsdl
    ::#################################################################
    @REM Update this with the PATH to USD NX_ROOT location
    @SET USD_SHORT_PATH=C:\Progra~1/CA/Servic~1/
    
    @REM Update this with the PATH to the JDK javac.exe compiler 
    @REM (this is used in the 2nd part of this file)
    @SET JAVAC_EXE="C:\j2sdk1.4.2_13\bin\javac.exe"
    @REM Update this to the path to the USD CA SDM r12.9 NX_ROOT/java/lib location
    @SET USD_TOMCAT=%USD_SHORT_PATH%java/lib
    @SET CP=%USD_TOMCAT%/axis.jar;%USD_TOMCAT%/commons-discovery.jar;%USD_TOMCAT%/commons-logging.jar;%USD_TOMCAT%/jaxrpc.jar;%USD_TOMCAT%/saaj.jar;%USD_TOMCAT%/log4j-1.2.8.jar;%USD_TOMCAT%/xml-apis.jar;%USD_TOMCAT%/xercesImpl.jar;%USD_TOMCAT%/wsdl4j.jar;%USD_TOMCAT%/axis-ant.jar
    @REM Please specify the path to java.exe file below
    @REM You can obtain this by reviewing the NX.env file use the @NX_JRE_INSTALL_DUR 
    @REM variable to derive this info
    @SET JAVA_PATH=C:\Program Files(x86)\CA\SC\JRE\1.6.0_30
    @SET JAVA_EXE="%JAVA_PATH%\bin\java.exe"
    @cd WEB-INF\classes
    %JAVA_EXE% -cp %CP% org.apache.axis.wsdl.WSDL2Java http://localhost:8080/axis/services/USD_Unicenter Service Desk Version 11.0_WebService?wsdl
    @cd ..\..
    ::##################################################################
    ::# This next section compiles the Service Desk stub code 
    ::# Once complete, you should recycle tomcat with the following 
    ::# commands or by recycling Service Desk:
    ::#       pdm_tomcat_nxd -c STOP
    ::#       pdm_tomcat_nxd -c START
    ::##################################################################
    @SET CP=".\classes;%CP%"
    @SET STUBS_DIR=classes\com\ca\www\UnicenterServicePlus\ServiceDesk
    @cd WEB-INF
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\ArrayOfInt.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\ArrayOfString.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\ListResult.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\USD_WebService.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\USD_WebServiceLocator.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\USD_WebServiceSoap.java
    %JAVAC_EXE% -classpath %CP% -deprecation -d classes %STUBS_DIR%\USD_WebServiceSoapSoapBindingStub.java
    @cd ..
    

    After running the batch file from the command prompt, the stub classes are in place and compiled.

  6. Recycle Tomcat as follows: