116 Building SOA-based Solutions for IBM System i Platform
7.1 Project investments in developing a service
In wrappering existing business logic as a HATS Web service, you need to consider the
following items for using SOA:
򐂰 Analyze the current state of the business application.
򐂰 Consider the time frame for the prototyping and production of a services application.
You need to consider also the application development, expense, and deployment for
developing a Web service based application.
7.1.1 Analyzing an existing application
HATS Web service is a good solution where the existing applications can be driven using
macros. With some applications, where it is not possible to drive the application using a
macros, HATS Web service might not be a simple solution. You might require some
modifications to the existing application flow to automate it using a macro.
Consider the following scenarios in our Flight Reservation System sample application:
1. Flight Reservation Inquiry
This is a very simple scenario. The application window has only one input parameter and
based on the input, it retrieves data from the database table. This application transaction
can be driven easily with macro.
Let us look at the transaction details and the navigation required in completing the
transaction.
a. Start personal communication session to your System i5.
b. Run this command to add a library to the library list:
ADDLIBLE FLGHT400
c. Call the Flight Reservation System application:
GO FLGHT400/FRSMAIN
Chapter 7. HATS Web service 117
d. Enter 3 - Inquire on an Existing Reservation on the Flight Reservation main menu
panel and press Enter (see Figure 7-1).
Figure 7-1 Flight Reservation System main menu
e. You should see a logon panel. Enter Alex as agent name and mercury as the
password. Press F10.
f. Enter the order number 005530217 and press F10 to work with selection (see
Figure 7-2).
Figure 7-2 Order Selection panel
FRSMAINX 16:27:57 Flight Reservation System 7/29/06 SYSTEMI5
Select one of the following:
1. Create a New Reservation
2. Update an existing Reservation
3. Inquire on an existing Reservation
4. Delete an existing Reservation
5. Fax Reservation Information
10. Flight Reservation System Maintenance
20. Reservation System Reports
90. Signoff
Selection or command
===> 3
F3=Exit F4=Prompt F9=Retrieve F12=Cancel
F13=Information Assistant F16=AS/400 main menu
Flight Reservation System - Order Selection Panel System: SYSTEMI5
Type choices, press F10 to continue
Customer Name . . . . Name ( F4 to Select )
Date of Departure . . . . . . . . . 0000 00 00 Date ( F5 to Select )
Order Number . . . . . . . . . . . 005530217 Order Number
F2=Refresh F3=Exit F10=Work with Selection
118 Building SOA-based Solutions for IBM System i Platform
g. Review the order and press F3 or F12 to exit the Display Order panel (see Figure 7-3).
h. Press F3 to exit from Order Selection Panel.
Figure 7-3 Display Order panel
2. Flight Selection Search and Flight Reservation Transaction
First let us look at the Flight Reservation Transaction and learn about the data entry fields
and flow of the transaction:
a. Make sure that you are on Flight Reservation System main menu panel.
b. Enter 1 - Create a new Reservation on the Flight Reservation System main menu
panel.
c. You should see a logon panel. Enter Alex as agent name and mercury as the
password. Press F10.
Flights Reservation System - Display Order 16:44:46 7/29/06 SYSTEMI5
FLIGHT INFORMATION TICKET ORDER INFORMATION
Airline: DLT Flight: 5117009 Order Number...............: 005530217
Date of Flight..: 03 12 2004 Customer....: Aaronson, Linda
Class of Service - First...........:
From City: Little Rock Business........:
Economy.........: X
Depart Time.......: 07:54 AM
Number of Tickets..................: 01
To City...: Norfolk Price $.....................: 169.00
Tax $.......................: 6.76
Arrival Time......: 09:54 AM Total Due w/ Tax $..........: 175.76
F3/F12=Exit
Chapter 7. HATS Web service 119
d. Enter the date of the flight (Figure 7-4) for example:
09 12 2006
Figure 7-4 Create order: Date of flight
Flights Reservation System - Create Order 17:01:58 7/29/06 SYSTEMI5
Type choices, press F10 to Make Reservation
FLIGHT INFORMATION TICKET ORDER INFORMATION
Airline: Flight: 0000000 Order Number...............: PENDING
Date of Flight..: 09 12 2006 Customer...:
Class of Service - First...........:
From City.: Business........:
Economy.........: X
Depart Time.......:
Number of Tickets..................: 01
To City...: Price $.....................:
Tax $.......................:
Arrival Time......: Total Due w/ Tax $..........:
F2=Refresh F4=FROM Cities F5=TO Cities F6=Flights F7=Customers

Get Building SOA-based Solutions for IBM System i Platform now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.