Chapter 1. Introduction to Web Services

Table of Contents

1.1. Basic Concept of a Web Service
1.2. Web Service Standards
1.2.1. SOAP Standard
1.2.2. WSDL Standard
1.2.3. UDDI Standard
1.2.4. JAX-WS, JAXB, StAX Standards
1.2.5. JAX-RPC Standard
1.2.6. SAAJ Standard
1.3. SOAP Message Exchange and Encoding

This chapter introduces the basic web service concepts and standards.

A web service is a standardized technology that enables applications to communicate with each other regardless of the platform and programming languages used, and the software interface that implements network access by using the standard XML messaging protocol. In addition, just with an Internet connection, a web service makes businesses available to any user with authority to use the service. For its use, it also defines a convenient environment for the messaging protocol, programming standard, and discovery service.

A web service is an application program that can be accessed through a URI over the Internet. Its interfaces and bindings can be defined and described by XML artifacts. A web service not only communicates with other web services published on the Internet, but it can also communicate with legacy back-end applications.

Until recent years, every application architecture was classified into two major types. One is a single tier mainframe-based system, and the other is a two tier client-server architecture running on a desktop. These architectures are tightly coupled and lack extensibility. Since programs within these architectures are too restricted and difficult to access, they are not useful for users on the web.

This limitation steered the software industry toward Service-Oriented Architecture (SOA), which enables application programs to dynamically communicate with each other on the web. The application programs drove software systems to be divided into modularized sub-systems, and the sub-systems have been implemented using various technologies. They do not need to exist in a single computer, and can also be reused. They are also designed to be accessible to any user on the web through the use of standard web protocols such as XML and HTTP.

SOA is not a new concept. It has been implemented from years ago in many different forms including RMI, COM and CORBA. However, these technologies are either vendor-specific or technology-specific, which prevents them from being universally adapted. Web services have been designed to overcome such shortcomings.

The following are the features of Web services.

The following are the advantages of Web services

  • Supports Internet open standards and is defined by industry agreed standards. As web services communicate based on universally agreed standards such as SOAP (Simple Object Access Protocol), WSDL, and UDDI (Universal Description, Discovery, and Integration), applications supporting web services are not faced with communication problems.

  • Platform and programming language independent.

  • Communicates through web protocols like HTTP, making it easy to communicate through the current security-heavy network environment with numerous firewalls.

With the release of Java EE (Java 2 Platform, Enterprise Edition) specification version 1.4, web services became a significant part of Java EE standard. Services including transaction support, database connection, and life cycle management can now be supported without modifying the program source code.

To provide better web services, new specifications have been added to Java EE (Java Enterprise Edition, the new name of J2EE) version 5, and the functions of existing specifications have been re-organized and improved.

The following are the standards that the current JEUS web services must conform to.

The following sections describe some of the main standards.

SOAP supports RPC and document-oriented methods for exchanging messages. SOAP uses the encoding mechanism configured as the EncodingStyle attribute for the SOAP message element.

This section describes the characteristics of a SOAP message.

  • SOAP Message Composition

    A SOAP message has a SOAP envelope, and the envelope has two sub-elements: header and body. The header is optional, and its sub-elements, header blocks, may be seen as logical sets of data. The SOAP body, an essential element of a SOAP message, contains the contents of the actual message that needs to be delivered.