P.2. Chapter-by-Chapter Overview
The book has seven chapters, the last of which is quite short. Here is a preview of each chapter:
Chapter 1
This chapter begins with a working definition of web services, including the distinction between SOAP-based and REST-style services. This chapter then focuses on the basics of writing, deploying, and consuming SOAP-based services in core Java. There are web service clients written in Perl, Ruby, and Java to underscore the language neutrality of web services. This chapter also introduces Java's SOAP API and covers various ways to inspect web service traffic at the wire level. The chapter elaborates on the relationship between core Java and Metro.
Chapter 2
This chapter focuses on the service contract, which is a WSDL (Web Service Definition Language) document in SOAP-based services. This chapter covers the standard issues of web service style (document versus rpc) and encoding (literal versus encoded). This chapter also focuses on the popular but unofficial distinction between the wrapped and unwrapped variations of document style. All of these issues are clarified through examples, including Java clients against Amazon's E-Commerce services. This chapter explains how the wsimport utility can ease the task of writing Java clients against commercial web services and how the wsgen utility figures in the distinction between document-style and rpc-style web services. The basics of JAX-B (Java API for XML-Binding) are also covered. This chapter, like the others, is rich in code examples.
Chapter 3
This chapter introduces SOAP and logical handlers, which give the service-side and client-side programmer direct access to either the entire SOAP message or just its payload. The structure of a SOAP message and the distinction between SOAP 1.1 and SOAP 1.2 are covered. The messaging architecture of a SOAP-based service is discussed. Various code examples illustrate how SOAP messages can be processed in support of application logic. This chapter also explains how transport-level messages (for instance, the typical HTTP messages that carry SOAP payloads in SOAP-based web services) can be accessed and manipulated in JAX-WS. This chapter concludes with a section on JAX-WS support for transporting binary data, with emphasis on MTOM (Message Transmission Optimization Mechanism).
Chapter 4
This chapter opens with a technical analysis of what constitutes a REST-style service and moves quickly to code examples. The chapter surveys various approaches to delivering a Java-based RESTful service: WebServiceProvider, HttpServlet, Jersey Plain Old Java Object (POJO), and restlet among them. The use of a WADL (Web Application Definition Language) document as a service contract is explored through code examples. The JAX-P (Java API for XML-Processing) packages, which facilitate XML processing, are also covered. This chapter offers several examples of Java clients against real-world REST-style services, including services hosted by Yahoo!, Amazon, and Tumblr.
Chapter 5
This chapter begins with an overview of security requirements for real-world web services, SOAP-based and REST-style. The overview covers central topics such as mutual challenge and message confidentiality, users-roles security, and WS-Security. Code examples clarify transport-level security, particularly under HTTPS. Container-managed security is introduced with examples deployed in the standalone Tomcat web container. The security material introduced in this chapter is expanded in the next chapter.
Chapter 6
This chapter starts with a survey of what comes with a Java Application Server (JAS): an EJB container, a messaging system, a naming service, an integrated database system, and so on. This chapter has a variety of code examples: a SOAP-based service implemented as a stateless Session EJB, WebService and WebServiceProvider instances deployed through embedded Tomcat, a web service deployed together with a traditional website application, a web service integrated with JMS (Java Message Service), a web service that uses an @Entity to read and write from the Java DB database system included in GlassFish, and a WS-Security application under GlassFish.
Chapter 7
This is a very short chapter that looks at the controversy surrounding SOAP-based and REST-style web services. My aim is to endorse both approaches, either of which is superior to what came before. This chapter traces modern web services from DCE/RPC in the early 1990s through CORBA and DCOM up to the Java EE and .NET frameworks. This chapter explains why either approach to web services is better than the distributed-object architecture that once dominated in distributed software systems.
还行
|
> 我来回应