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 website 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.