Java 2EE and XML Development

Скачать в pdf «Java 2EE and XML Development»

4.4.1 What is a web service?


A web service is some set of functionality made available to remote applications and services via the Internet. A web service is described in XML, using the Web Services Definition Language (WSDL). As shown later in this section, a WSDL description contains details about what the service is, where to find it on the Web, and how to interact with it. Once created, this description is registered in a well-known location. Figure 4.13 depicts a sample web service. There are currently two popular, competing standards in the web services registry space, the ebXML Registry and Repository and Universal Description, Discovery, and Integration (UDDI). Of these, UDDI is more general-purpose and is rapidly gaining the support of a majority of the industry.

Figure 4.13 Basic structure of a web service


UDDI defines a system of interoperating service registries that collaborate over the Internet. Its operation is conceptually similar to the Domain Name System (DNS). In UDDI, businesses that provide web services register them with an official UDDI registrar. The registration is then propagated throughout the system, allowing any potential service consumer to search for and locate it via any UDDI engine.


Once a web service has been located, the interaction between producer and consumer takes place over standard Internet protocols such as HTTP, FTP, and SMTP. As described earlier, SOAP has an explicit binding to the HTTP protocol. This has made the use of SOAP for web service integration the de facto standard. Where secure interactions are required, HTTPS can be used instead.

Web service interfaces


A web se
rvice can be designed to use a one-way, message-based interface or a two-way, RPC-style interface. This is consistent with our JAXM examples from the previous section.

Скачать в pdf «Java 2EE and XML Development»