9.2.7 Modify passenger list application to use the Web Service

We are going to modify our passenger List application, to use the Web Service. The new approach includes an input form where the user can enter the flight Number to get the passenger List. The servlet receives this information and uses the Java proxy generated in 9.2.5 “Create the Web Service from DADX file” on page 199. The Web services returns XML data, which is transformed using XSLT Processor by the servlet, and returns and HTML response. See Figure 9-21 on page 208.

HTTP

HTML

Servlet

XSLT

Processor

XSLT

XML

Data

Java

Proxy

Web

Service

SOAP

Airline

DB

Figure 9-21 Passenger List application

Mapping DTDIDs to XSD namespaces and locations

The DTDID used by DXX is typically the local file path of the DTD. DXX retrieves the DTD either from the file system or the DTD_REF table. However, the use of a local file path is not appropriate for Web services since the result is sent to remote clients that do not have access to the server file system. The correct way to specify the document structure is by giving the namespace and location of an XML Schema (XSD) document for the result. The namespace and location are specified using an <import> element in the WSDL document that describes the Web Service.

DxxInvoker must, therefore, associate an XSD namespace and location with each DTDID that is used in the DAD documents that are referenced by the

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

Page 224
Image 224
IBM Version 5 Modify passenger list application to use the Web Service, Mapping DTDIDs to XSD namespaces and locations