Tutorial 1: Generating com.actuate.schemas library
In this tutorial, you use the Apache Axis WSDL2Java tool to generate, compile, and deploy the com.actuate.schemas code library from the Actuate WSDL document using the build.bat script file packaged with Actuate iServer Integration Technology. You perform the following tasks:
*Access the Actuate WSDL document using a web browser
*Generate the com.actuate.schemas library from the Actuate WSDL document
*Examine the generated Java code library
To complete this exercise, you need access to the following files from the ActuateiHubIntegrationTechnology-ihub3.zip archive:
<Extraction path>\ServerIntTech3\Web Services\Examples\Axis Client\build.bat
To use the build.bat script file in this tutorial, you also need the Apache Ant build tool and environment variables set to access the iHub JDK and Apache Ant installations.
Task 1: Set the JAVA_HOME, ANT_HOME and Path environment variables
To configure the Apache Ant to build iHub Integration Technology Java RSSE applications, you must set the JAVA_HOME, ANT_HOME and Path variables on your computer.
1 Choose StartSettingsControl Panel. In Windows 7, choose StartComputerSystem Properties.
Control Panel appears.
2 On Control Panel, double-click System.
System Properties—General appears.
3 On System Properties—General, choose Advanced.
System Properties—Advanced appears, as shown in Figure 1-6.
Figure 20‑2 System Properties—Advanced
4 On System Properties—Advanced, choose Environment Variables.
Environment Variables appears, as shown in Figure 1-7.
Figure 20‑3 Environment Variables
5 If not already set, add the JAVA_HOME environment variable by performing the following tasks:
1 In System Variables, choose New.
New System Variable appears.
2 On New System Variable, in Variable Name, type:
JAVA_HOME
3 In Variable Value, type the following path specifying the directory where Actuate installed the Java, similar to the following:
C:\Actuate3\BIRTiHubEvaluation\modules\JDK64
4 New System Variable appears as shown in Figure 1-8.
Figure 20‑4 Creating a new JAVA_HOME system variable
Choose OK.
6 If already set, perform the following tasks to change the JAVA_HOME environment variable:
1 In System Variables, select JAVA_HOME. Choose Edit.
Edit System Variable appears.
2 On Edit System Variable, in Variable Name, type:
JAVA_HOME
3 In Variable Value, type the following path specifying the directory where Actuate installed the Java SDK, similar to the following:
C:\Actuate3\BIRTiHubEvaluation\modules\JDK64
4 New System Variable appears as shown in Figure 1-8.
Figure 20‑5 Editing the JAVA_HOME system variable
Choose OK.
7 On Environment Variables, add the ANT_HOME environment variable by performing the following tasks:
1 In System Variables, choose New.
New System Variable appears.
2 On New System Variable, in Variable Name, type:
ANT_HOME
3 In Variable Value, type the path for the directory where WinZip extracted the Apache Ant files, similar to the following:
C:\apache-ant-1.7.0
New System Variable appears, as shown in Figure 1-20.
Figure 20‑6 Creating a new ANT_HOME system variable
4 Choose OK.
8 On Environment Variables, edit the Path environment variable by performing the following tasks:
1 In System Variables, select Path. Choose Edit.
Edit System Variable appears.
2 In Variable Value, if not already set, append a semicolon at the end of the Path specification to separate the new path from the existing paths. Then, append the following text to the existing Variable Value text:
%JAVA_HOME%\bin;%ANT_HOME%\bin;
3 Edit System Variable appears, as shown in Figure 1-10.
Figure 20‑7 Editing the Path system variable
4 Choose OK.
9 On Environment Variables, choose OK.
10 To close System Properties, choose OK.
11 To close Control Panel, choose FileClose.
Task 2: Access the Actuate WSDL document using a web browser
You can use a web browser to view the Actuate 11 WSDL document on the Encyclopedia volume.
1 In Windows, choose StartProgramsInternet Explorer.
Internet Explorer appears.
2 Access the following URL:
http://localhost:8000/wsdl
Browsing Certified WSDL Utilities—Microsoft Internet Explorer appears, displaying links to the versions of Actuate WSDL documents, as shown in Figure 5-6.
Figure 20‑8 Links to environment-specific versions of the Actuate WSDL documents
3 In IDAPI Actuate 11, choose Apache Axis.
Browsing APIs—Microsoft Internet Explorer appears.
4 Choose Login.
The login page appears.
5 Examine the Login WSDL definition the WSDL utility displays, including the following elements:
Namespace and attribute declarations
*Types
*Messages
*PortType
*Bindings
*Services
*Ports
Task 3: Generate the com.actuate.schemas library from the Actuate WSDL document
In this task, you generate the com.actuate.schemas library using the online version of the Actuate WSDL document. You run the WSDL2Java tool from a command window using the build.bat file.
1 Choose StartProgramsAccessoriesCommand Prompt.
A command prompt window appears.
2 At the command prompt, type:
cd <Extraction path>\ServerIntTech3\Web Services\Examples\Axis Client
Press Enter.
3 At the command prompt, type:
build
Press Enter.
Build.bat executes the following commands:
@if "%HOSTNAME%" == "" set HOSTNAME=localhost
@if "%PORT%" == "" set PORT=8000
@if not "%1" == "" set HOSTNAME=%1
@if not "%2" == "" set PORT=%2
mkdir build
call setClassPath.bat
ant compile -DhostName=%HOSTNAME% -Dport=%PORT%
Task 4: Examine the generated Java code library
In this task, you examine the source code files in the com.actuate.schemas library.
1 Using Windows Explorer, navigate to the following directory:
<Extraction path>\ServerIntTech3\Web Services\Examples\Axis Client\Source
2 Examine the following files in the com\actuate\schemas folder:
*Login.java
Examine the following items in the code:
*Java attribute and related accessor methods generated from the WSDL type definitions
*Type metadata descriptors that map each Java attribute to its corresponding XML element
*JavaBean getSerializer( ) and getDeserializer( ) methods
*ActuateSoapPort.java
Examine the following items in the code:
*ActuateSoapPort extends java.rmi.Remote defining the interface the application uses to access a web service in a remote procedure call
*SDI for com.actuate.schemas.LoginResponse login( )
*ActuateSoapBindingStub.java
Examine the following items in the code:
*Proxy code that enables the application to call a remote service as a local object
*Stub that converts the Java call to a SOAP call for a login operation