142 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
2. In the preferences editor, go to J2EE and select Enable server targeting
support.
Next, you need to create projects of the different types that we used to structure
the artifacts that we produced. You need to create the following projects:
???? A Service project, which we used to generate the IMS access code and the
Trader system process.
???? An EJB project, because TraderIMSFeature and TraderIntegration are
implemented as session EJBs.
???? An Enterprise Application project that contains the EJB project.
To create the projects:
1. Select File
New Project from the menu bar or click the top-left symbol
in the extended menu bar.
2. Specify Integration Server 5.1 as the target server when you create the
Enterprise Application and the EJB project.
3. Make sure that wsatlib.jar is added to the Java Build Path for the EJB
project. If not, add it manually by right-clicking the Service project and
selecting Properties.
4. In the window that opens, choose Java Build Path and go to the Libraries
tab.
5. Click either the Add External Jars or the Add Variable.
6. Click WAS_EE_V5.1 for the directory and then the Expand button to add the
Jar file. You can find the wsatlib.jar file in the subfolder runtimesee_v5.1lib.
When creating the Java utility classes for IMS access, we recommend that you
test the artifacts by calling the IMS transaction from a test class. This test class
can be a simple Java class, because the J2C IMS connector can run in a J2SE
environment. To use the JUnit framework for the test class, you have to add the
JUnit libraries to the Java build path of the Service project:
1. Open the Properties window.
2. Choose Java Build Path and go to the Libraries tab.
3. Click either the Add External Jars or the Add Variable.
4. Click Eclipse_Home for the directory and the Expand button to add the JUnit
JAR file. You can find the junit.jar file in the subfolder
eclipsepluginsorg.junit_3.8.1.
Chapter 6. EIS integration using Java Message Service 143
Finally, because we intend to generate code to access IMS via the J2C
connector, the IMS resource adapter has to be imported into the workspace.
1. Select File
Import from the menu bar to open the import wizard.
2. In the window select File System and browse to the resource adaptersims
directory.
3. Select ims222.rar.
4. Enter a name for the connector project and click Finish.
You should now see two new projects in the Navigator view: the connector
project and a project named J2C Tool Plugin Import Service.
Creating the IMS access code
We used the J2C IMS connector and Java utility classes that are generated by
WebSphere Studio Application Developer Integration Edition to implement the
Trader IMSFeature session bean. In the following paragraphs, we show how to
create the utility classes for a specific IMS transaction that provides a stock order
function.
Before you start using the wizard to generate the classes, you first have to gather
details on the IMSConnect and IMS system running on the zSeries host. At a
minimum, you should know the following parameters: hostname, port, IMS
datastore, username, and password. You also have to request the COBOL
copybook that describes the input and output data for the transactions. Import
the COBOL copybook into your Service project by selecting File
Import. You
may want to create a Java package first, to structure the project folder.
The wizard we used to create the utility classes also generates a service binding.
We do not use the service as generated by the tool directly in a business process
because it exposes the IMS COBOL copybook details at the service interface.
We recommend that you hide these technical details in a system process, or, as
shown in the following sections, develop an EIS component that encapsulates
the EIS access details.
You start the wizard to generate the Java utility classes from the Business
Integration perspective:
1. Click File
New Service build from.
Input for the process are IMS system details and COBOL copybook, and the
output includes WSDL files and Java classes.
2. From the Service Creation wizard, select IMS as the back-end technology
and click Next.
3. Enter the IMS system parameters as depicted in Figure 6-8. Enter hostname,
port, IMS datastore, username, and password and click Next.
144 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
Figure 6-8 IMS system parameters
4. Select the source folder (your service project), enter a package name, and
enter a service name. Click Finish.
5. The wizard creates Web Services Description Language (WSDL) files for the
service, and the WSDL editor opens (see Figure 6-9 on page 145).
Chapter 6. EIS integration using Java Message Service 145
Figure 6-9 IMS service bindings in the WSDL editor
6. In the WSDL editor, right-click and the select Generate Binding Content.
The binding wizard opens.
7. In the Binding wizard, make sure that IMS is selected as the binding protocol,
and click Add to create a new binding operation.
8. In the New Binding Operation window that opens, enter the operation name,
and click Next.
9. You can accept the defaults in the next window. For more information about
the parameters shown here, refer to the WebSphere Studio Application
Developer Integration Edition Help (search for
IMS Sample).
10.In the next window that opens, select z/OS as the platform on which IMS is
running. Click Next.
11.Specify the input and output messages for the IMS transaction by importing
from the COBOL copybook. Click Import to select the input message.
146 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
12.Browse to the COBOL copybook that you have imported, and click Next. See
Figure 6-10.
Figure 6-10 IMS COBOL copybook import and buffer selection
13.Select the data structure that you have to pass to the transaction as the input
message as shown Figure 6-10. Click Finish.
14.The wizard finishes, and you are back at New Binding Operation window. If
the transactions use a different data structure as output, import the data
structure as described in the previous steps. Otherwise, select Use the input
message for output. Click Finish.
The wizard creates new binding elements as depicted in Figure 6-11 on
page 147. All the information that is required to generate the Java utility classes
is kept in the three WSDL files that get generated: the interface description, the
binding details, and the service details. The binding details contain the
information that is required for setting up the byte stream that is required by the
IMS system. The service details contain all the parameters that are required to
connect to the IMS system.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset