Synopses & Reviews
Learn how to develop REST-style and SOAP-based web services and clients with this quick and thorough introduction. This hands-on book delivers a clear, pragmatic approach to web services by providing an architectural overview, complete working code examples, and short yet precise instructions for compiling, deploying, and executing them. Youll learn how to write services from scratch and integrate existing services into your Java applications.
With greater emphasis on REST-style services, this second edition covers HttpServlet, Restlet, and JAX-RS APIs; jQuery clients against REST-style services; and JAX-WS for SOAP-based services. Code samples include an Apache Ant script that compiles, packages, and deploys web services.
- Learn differences and similarities between REST-style and SOAP-based services
- Program and deliver RESTful web services, using Java APIs and implementations
- Explore RESTful web service clients written in Java, JavaScript, and Perl
- Write SOAP-based web services with an emphasis on the application level
- Examine the handler and transport levels in SOAP-based messaging
- Learn wire-level security in HTTP(S), users/roles security, and WS-Security
- Use a Java Application Server (JAS) as an alternative to a standalone web server
Synopsis
The second edition of Java Web Services keeps the hands-on, example-driven approach, but makes code samples easier to use by providing Ant scripts for the main examples. Also, the author is more forthright in assessing the Java technologies. For example, there are three obvious ways that a Java programmer might deliver a RESTful service: as a standard Java servlet (published in the usual way with a web server such as Tomcat), as a JAX-WS WebServiceProvider, or as a JAX-RS resource and he will rank them accordingly.
About the Author
Martin Kalin has a Ph.D. from Northwestern University and is a professor in the College of Computing and Digital Media at DePaul University. He has co-written a series of books on C and C++ and written a book on Java for programmers. He enjoys commercial programming and has co-developed large distributed systems in process scheduling and product configuration.
Table of Contents
Preface; What's Changed in the Second Edition?; Web Service APIs and Publication Options; Chapter-by-Chapter Overview; Tools and IDEs; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Chapter 1: Web Services Quickstart; 1.1 Web Service Miscellany; 1.2 What Good Are Web Services?; 1.3 Web Services and Service-Oriented Architecture; 1.4 A Very Short History of Web Services; 1.5 What Is REST?; 1.6 Review of HTTP Requests and Responses; 1.7 HTTP as an API; 1.8 A First RESTful Example; 1.9 Why Use Servlets for RESTful Web Services?; 1.10 What's Next?; Chapter 2: RESTful Web Services: The Service Side; 2.1 A RESTful Service as an HttpServlet; 2.2 A RESTful Web Service as a JAX-RS Resource; 2.3 A RESTful Web Service as Restlet Resources; 2.4 A RESTful Service as a @WebServiceProvider; 2.5 What's Next?; Chapter 3: RESTful Web Services: The Client Side; 3.1 A Perl Client Against a Java RESTful Web Service; 3.2 A Client Against the Amazon E-Commerce Service; 3.3 A Standalone JAX-B Example; 3.4 Another Client Against the Amazon E-Commerce Service; 3.5 The CTA Bus-Tracker Services; 3.6 RESTful Clients and WADL Documents; 3.7 The JAX-RS Client API; 3.8 JSON for JavaScript Clients; 3.9 What's Next?; Chapter 4: SOAP-Based Web Services; 4.1 A SOAP-Based Web Service; 4.2 The RandService in Two Files; 4.3 Clients Against the RandService; 4.4 The WSDL Service Contract in Detail; 4.5 SOAP-Based Clients Against Amazon's E-Commerce Service; 4.6 What's Next?; Chapter 5: SOAP Handlers and Faults; 5.1 The Handler Level in SOAP-Based Services and Clients; 5.2 Handlers and Faults in the predictionsSOAP Service; 5.3 A Handler Chain with Two Handlers; 5.4 SOAP-Based Web Services and Binary Data; 5.5 The Transport Level; 5.6 Axis2; 5.7 What's Next?; Chapter 6: Web Services Security; 6.1 Wire-Level Security; 6.2 A Very Lightweight HTTPS Server and Client; 6.3 HTTPS in a Production-Grade Web Server; 6.4 Container-Managed Security; 6.5 WS-Security; 6.6 What's Next?; Chapter 7: Web Services and Java Application Servers; 7.1 The Web Container; 7.2 Toward a Lightweight JAS; 7.3 GlassFish Basics; 7.4 Servlet-Based Web Services Under GlassFish; 7.5 An Interactive Website and a SOAP-Based Web Service; 7.6 A @WebService as a @Stateless Session EJB; 7.7 TomEE: Tomcat with Java EE Extensions; 7.8 Where Is the Best Place to Be in Java Web Services?; Index; Colophon;