Chapter 5. Client Design

Web services take the Web client model to the next level. Developers can write far more powerful clients whose interaction with Web services provides a rich client experience. In this environment, client developers need not have control over the server portion of an application, yet they can still write powerful, rich client applications. This chapter focuses on using the Java platform to design and develop Web services-based clients.

Clients can take advantage of Web services to obtain a wide range of functions or services. To a client, a Web service is a black box: The client does not have to know how the service is implemented or even who provides it. The client primarily cares about the functionality—the service—provided by the Web service. Examples of Web services include order tracking services, information look-up services, and credit card validation services. Various clients running on different types of platforms can all access these Web services.

One of the principal reasons for implementing Web services is to achieve interoperability. Clients can access Web services regardless of the platform or operating system upon which the service is implemented. Not only is the service's platform of no concern to the client, the client's implementation language is completely independent of the service.

Web service clients can take many forms, from full-blown J2EE applications, to rich client applications, even to light-weight application clients, such as wireless devices. In short, there are many different types of clients that can talk to Web services. The Java platform provides excellent support for writing Web service clients. Web services also provide clients a standardized approach to access services through firewalls. Such access extends the capabilities of clients. Clients accessing Web services also remain more loosely coupled to the service.

We start by looking at the different means for communicating with Web services 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 clients. 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 discussion are recommendations and guidelines to help developers choose the optimal approach. The chapter concludes with guidelines for packaging client applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset