Argomento precedente: Implementazione di loginServiceManaged in Java

Argomento successivo: impersonate

Generazione di classi stub con WSDL2Java

È possibile generare le classi stub per i servizi Web di CA SDM.

Per generare classi stub con WSDL2Java

  1. Aprire un prompt dei comandi e passare alla directory "<unità>:\Program files\CA".

    La directory appare.

  2. Eseguire il comando dir /x.

    Viene visualizzata la forma breve della directory CA SDM. Ad esempio, il nome breve è "SERVIC~1,"

  3. Cercare il file javac.exe in tutte le unità locali del server. Se viene individuato, prendere nota del percorso in quanto sarà necessario farne riferimento in un file batch.

    Nota: se non si riesce a trovare il file javac.exe, visitare il sito Http://java.sun.com e cercare il pacchetto Java J2SE SDK da scaricare. Potrebbe essere necessario riavviare il computer.

  4. Creare un file batch denominato build_wsdl.bat e inserirlo nella directory seguente:
    $NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\axis
    
  5. Utilizzare il codice seguente per il file batch, aggiornando le voci in grassetto nel modo appropriato:
    @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 Unicenter Service Desk Version 12.7 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 ..
    

    Dopo aver eseguito il file batch dal prompt dei comandi, le classi stub sono nella posizione desiderata e compilate.

  6. Ripetere Tomcat nel modo seguente: