Figure 9-22 Input form GetPassengerList.html

This input form sends a flight number entered by the end user to the servlet. The servlet calls the Web Service using its Java proxy, and transfer the returned XML format into an HTML page and call it, See Figure 9-23 on page 213. The Java proxy was generated by the Web Service wizard, and the source code of this proxy is provided. We only need to know which method to call.

Using Java proxy

The Java proxy that is generated by Web services wizard enables to access to the Web services by method call instead of standard Web Service invocations. To use PassengerListProxy, instantiate the proxy and call the retrieve_passengerList_rdb method which is we defined in the Web services wizard. The result can be a source for the Transformer class:

passengerListProxy proxy = new passengerListProxy(); proxy.retrieve_passengerList_rdb_(key);

JAXP DOM I/O

To make the result as an input for the transformer, creating org.w3c.dom.Document format is the best way to do. To create the document from the result of the Web Service, use following statement:

DOMSource domSource = new DOMSource(proxy.retrieve_passengerList_rdb_(key)); transformer.transform(domSource, new StreamResult(pw));

212 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 228
Image 228
IBM Version 5 manual Using Java proxy, Input form GetPassengerList.html