48 Building SOA-based Solutions for IBM System i Platform
The ReserveFlight procedure inputs OrderInfo, which is a data structure of ReserveInfo.
The ReserveFlight returns a confirmation number with OrderNumber displayed (see
Figure 5-14).
Figure 5-14 OrderInfo is data structure with following declarations
11.Click X in the NFS001.RPGLE tab at the top of the window to close the window.
5.2.5 Creating and testing RPG Web service
In the previous section, you examined the RPG procedures. Now, you create a Web service
directly from the RPG source code that externalizes the RPG procedure:
1. Under QRPGLESRC, right-click NFS001.rpgle and select Web services Create Web
service as shown in Figure 5-15.
Figure 5-15 Create Web service from RPG code
Chapter 5. ProgramCall (RPG, Cobol) Web service 49
2. In the Web service dialog box, make sure that the following options are selected as shown
in Figure 5-16:
Web service Type: iSeries Program Web service
–Check Start Web service in Web Project
–Check Generate a Proxy
–Check Test the Web service
3. Click Next.
Figure 5-16 Web service Wizard
50 Building SOA-based Solutions for IBM System i Platform
4. On the Object Selection Page, do the following (see Figure 5-17):
–Select COMPUTEPRICE in Program Call Definition and change the value of Program
Object to NFS001
–Select FINDORDERCUST in Program Call Definition and change the value of Program
Object to NFS001.
–Select FINDORDERDATE in Program Call Definition and change the value of Program
Object to NFS001.
–Select GETORDERINFO in Program Call Definition and change the value of Program
Object to NFS001.
–Select RESERVEFLIGHT in Program Call Definition and change the value of Program
Object to NFS001.
–Select UPDATEORDER in Program Call Definition and change the value of Program
Object to NFS001.
Figure 5-17 Setting Service Program for Program Object
Chapter 5. ProgramCall (RPG, Cobol) Web service 51
5. Expand RESERVEFLIGHT and select the ORDERNUMBER and change the usage value
from input & output to output as shown in Figure 5-18.
Figure 5-18 Setting ReserveFlight Parameter
52 Building SOA-based Solutions for IBM System i Platform
6. Click Edit as in Figure 5-19.
Figure 5-19 System i Connection Information

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.