SOAP-Based Web Services

JADE provides a framework that enables you to build distributed JADE applications using the Extensible Markup Language (XML) Web Services architecture.

A Web service is a Uniform Resource Locator (URL) addressable set of functionality that is exposed over a network to serve as a building block for creating distributed applications.

You cannot run Unicode Web service applications.

In the first part of this chapter, the term Web service specifically refers to an XML‑based Web service. JADE supports the Web service provider and Web service consumer. For details, see "JADE Web Service Provider" and "JADE Web Service Consumer", respectively, in the following subsections.

Only the HTTP protocol is directly supported in this release. If you do not want to use the jadehttp communications module provided as part of the Web services framework, you can still invoke the Web service from your own code. (For more details, see "Using Communications Protocols Other than HTTP in your Web Service", later in this chapter.) For example, you could write your own Simple Mail Transfer Protocol (SMTP) handler to receive e‑mail and create a SOAP message from this e‑mail. You can then create an instance of the Web service class to which the SOAP message can be sent, which will invoke the appropriate method and return a SOAP message as a response. This SOAP message can then be sent back to the user or processed further.

The foundations for Web services are HyperText Transfer Protocol (HTTP), XML, and Simple Object Access Protocol (SOAP, a lightweight HTTP and XML‑based protocol that is used for information exchange), which are governed by the World Wide Web Consortium (W3C). As Web services encapsulate the implementation and provide an interface for communicating with the Web service, you can use them as building blocks for applications.

There is no restriction on the granularity of a Web service. It can range from simple components (for example, an order‑tracking component published by a shipping company) to large applications (for example, hosted financial applications). You can apply Web services at many different levels of a solution.

Web services can provide convenient access to a static set of information; for example, a Web service can allow a customer to request demographic information for a specified city. Alternatively, you could use Web services to implement highly interactive applications; for example, a travel Web site might make it possible to build an entire vacation itinerary online, by using multiple Web services. A user of that travel application could then use Web services to make hotel and rental car reservations, plan flight itineraries, book flights, and so on.

A Web service can aggregate other Web services to provide a sophisticated set of services; for example, a Web service for a real estate agency can make use of a Web service for a credit verification to facilitate approval of online loan applications. Web services provide:

JADE includes an XML parser, which is based on the Expat XML parser library. The JADE XML parser provides a Document Object Model (DOM) interface and a Simple API for XML (SAX) interface. For details about the XML parser and the RootSchema system classes that support this, see Chapter 12, "Processing XML Documents".

For details about generating a Web service consumer unit test class and stub methods, see "Generating a Web Service Consumer Unit Test Class and Stub Methods", in Chapter 17.