200
Choosing a Communication Technology
We start by looking at the different means for communicating with Web ser
vices and applications, and then examine some typical scenarios where using Web
services based clients make sense. From there, the chapter discusses the different
types of clients that use Web services, particularly highlighting the different
design considerations for the principal Java clients: J2EE, J2SE, and J2ME cli
ents. Then the chapter addresses the steps for developing these client applications,
from locating a service through handling errors. It also covers the communication
APIs that client applications can employ to access a service. Included in this dis
cussion are recommendations and guidelines to help developers choose the
optimal approach. The chapter concludes with guidelines for packaging client
applications.
5.1
Choosing a Communication Technology
Web services are only one of several ways for a client to access an application ser
vice. For example, Java applications may access application services using
RMI/IIOP, JMS, or Web services. There are advantages and disadvantages with
each of these communication technologies, and the developer must weigh these con
siderations when deciding on the client application design.
Interoperability is the primary advantage for using Web services as a means of
communication. Web services give clients the ability to interoperate with almost
any type of system and application, regardless of the platform on which the
system or application runs. In addition, the client can use a variety of technologies
for this communication. Furthermore, different client types such as handheld
devices, desktop browsers, or rich GUI clients running on different platforms
and written in different languages may be able to access the same set of services.
Some applications may be designed such that their functionality is only accessible
via a Web service.
Web services use HTTP as the transport protocol, which enables clients to
operate with systems through firewalls. The service's WSDL document enables
clients and services that use very different technologies to map and convert their
respective data objects. For services and clients that are based on JAX RPC, the
JAX RPC runtime handles this mapping transparently.
Let's look at the different communication approaches that are available to a
J2EE client to access a service, including Web services, RMI/IIOP, and Java
Message Service. Clients can easily use the JAX RPC generated stub classes to
access a Web service. Although not as fast from a performance perspective as
New Page 1