To construct the components of SV000618:
- Create a Web project to hold all of the files you will create.
- Write a ListItems JSP file that lists items in the iSeries inventory
database. You can use Page Designer in iSeries Web development tools to
write the servlet. More specifically, you can lay out the page in the
Design view, and add appropriate code in the Source view. You also need
to insert a subfile Design Time Control (DTC) to interact with the TNLSTITM
RPG service program, filling the subfile with database records. You can
specify the service program in the DTC control settings.
Next, you need to use the Web Interaction wizard to create the input
page:
- Specify ListItems.jsp as the output page to list
inventory items, which ensures that the Web Interaction wizard creates a
ListItems.wit file.
- Make sure not to specify any program calls in the Web Interaction wizard
since the subfile DTC automatically invokes the TNLSTITM RPG service
program. The wizard also generates a ListItemsWitServlet that serves as
a link to invoke the ListItems.jsp page.
- To review the ListItemsWit.wit file generated by the Web
Interaction wizard:
- Expand SV001618 and double-click
ListItems.wit to display the interaction wizard for the
file.
- Click Next through the wizard to review the values specified
for the interaction.
Next, you need to write a GetCost JSP output page with Page Designer, which
takes input from the ListItems.jsp input page. When a
user clicks an item on the ListItems.jsp page, a GetCost.jsp
page displays details for the item.
After creating the GetCost.jsp page, use the Web
Interaction wizard to create a WitOrder interaction between
ListItems.jsp (that you select as the input page) and
GetCost.jsp (that you select as the output page):
Next, you need to import Web Services Definition Language (WSDL) files from
project SV000514 so that the administrator can retrieve the current cost of an
item from the wholesale supplier by pressing the Get cost
button.
- The Get cost button invokes
QryProdCostServlet.jsp and corresponding Web service from
project SV000514.
- Use the Web Services wizard and imported WSDL files to generate the Java
proxy code required to invoke the Web service.
- The QryProdCostServlet.jsp takes input from the
GetCost.jsp page, uses Java proxy code to invoke the
SV000514 Web service to find the cost of the selected item, and displays the
cost in a page called ReturnedCost.jsp.
- To view the QryProdCostServicesProxy.java code and
QryProdCostServlet.java:
- Expand SV001618 > source > proxy > soap.
- Double-click QryProdCostServicesProxy.java.
- For QryProdCostServlet.java, double-click
QryProdCostServlet.java, under SV001618 > source,
and note how it instantiates the Java proxy code.
Next, you need to use the Web Interaction wizard to link
ReturnCost.jsp as input and Order.jsp as
output so that the administrator can click an Order button to order
the selected item from the wholesale supplier.
- With this interaction, you do not need to use a program call, as the
linking of the two pages is enough to display the correct information.
- To view WitPlaceOrder.wit:
- Expand SV001618.
- Double-click WitPlaceOrder.wit to open the
interaction.
- Click Next through the wizard to review the specified
values.
Next, use the SV001586 Web service so that the administrator can specify
the size and quantity of ordered items.
- Import the SV001586 WSDL files into this project, generate Java proxy code
to invoke the Web service, and write an OrderSupplyServlet invoked when the
user presses the Order button from
Order.jsp.
- The servlet gathers information from Order.jsp, invokes
the Web service Java proxy code, which invokes the SV001586 Web service and
orders the item.
- The servlet displays OrderOK.jsp if the order is
successful, and an error page if unsuccessful.
- To see how the generated Web service proxy is instantiated and invoked to
use the SV001586 Web service:
- Expand SV000618 > source.
- Double-click OrderSupplyServlet.java and examine the
contents.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
Copyright IBM Corporation 1992, 2003. All Rights Reserved.