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. You’ll 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
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
Chapter 1 Web Services Quickstart
Web Service Miscellany
What Good Are Web Services?
Web Services and Service-Oriented Architecture
A Very Short History of Web Services
What Is REST?
Review of HTTP Requests and Responses
HTTP as an API
A First RESTful Example
Why Use Servlets for RESTful Web Services?
Chapter 2 RESTful Web Services: The Service Side
A RESTful Service as an HttpServlet
A RESTful Web Service as a JAX-RS Resource
A RESTful Web Service as Restlet Resources
A RESTful Service as a @WebServiceProvider
Chapter 3 RESTful Web Services: The Client Side
A Perl Client Against a Java RESTful Web Service
A Client Against the Amazon E-Commerce Service
A Standalone JAX-B Example
Another Client Against the Amazon E-Commerce Service
The CTA Bus-Tracker Services
RESTful Clients and WADL Documents
The JAX-RS Client API
Chapter 4 SOAP-Based Web Services
A SOAP-Based Web Service
The RandService in Two Files
Clients Against the RandService
The WSDL Service Contract in Detail
SOAP-Based Clients Against Amazon’s E-Commerce Service
Chapter 5 SOAP Handlers and Faults
The Handler Level in SOAP-Based Services and Clients
Handlers and Faults in the predictionsSOAP Service
A Handler Chain with Two Handlers
SOAP-Based Web Services and Binary Data
The Transport Level
Chapter 6 Web Services Security
A Very Lightweight HTTPS Server and Client
HTTPS in a Production-Grade Web Server
Chapter 7 Web Services and Java Application Servers
The Web Container
Toward a Lightweight JAS
Servlet-Based Web Services Under GlassFish
An Interactive Website and a SOAP-Based Web Service
A @WebService as a @Stateless Session EJB
TomEE: Tomcat with Java EE Extensions
Where Is the Best Place to Be in Java Web Services?
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.
The animal on the cover of Java Web Services: Up and Running, Second Edition, is agreat cormorant (Phalacrocorax carbo). This bird is a member of the Phalacrocoracidaefamily, which consists of about 40 species of cormorants and shags—large seabirds withhooked bills, colored throats, and stiff tail feathers. The name “cormorant” is derivedfrom the Latin corvus marinus, or sea raven, because of its black plumage.
An adult cormorant is about 30 inches long and has a wingspan of 60 inches. It has along neck, a yellow throat, and a white chin patch. The cormorant has a distinctive wayof spreading its wings as it perches, which many naturalists believe is a way of dryingits feathers, although this explanation is disputed. The cormorant lives mainly nearAtlantic waters, on western European and eastern North American coasts, and particularlyin the Canadian maritime provinces. It breeds on cliffs or in trees, building nestsout of twigs and seaweed.
The cormorant is an excellent fisher, able to dive to great depths. In China and Japan,other species of cormorants are trained to fish using a centuries-old method, in whichthey tie cords around the throats of the birds—to prevent them from swallowing—andsend them out from boats. The cormorants then catch fish in their mouths, return tothe boats, and the fishermen retrieve their catch. Although once a successful industry,today cormorant fishing is primarily used for tourism.
The cover image is from Cassell’s Popular Natural History, Vol. III: Birds. The coverfont is Adobe ITC Garamond. The text font is Adobe Minion Pro; the heading font isAdobe Myriad Condensed; and the code font is Dalton Maag’s Ubuntu Mono.
Comments about oreilly Java Web Services: Up and Running, 2nd Edition:
It has been recently released The second edition of Java Web Services: Up & Running, this means full new content (almost a trend in O'reilly Java titles), and not only an update of bugs and reader's comments.
This new edition focuses in the (not new, but fashion) RESTful services. Today, it is clear the current trend is to use less restrictive REST services and lightweight JSON. Keeping most chapters under this context, it get along with examples and info about WADL, Security JSON, etc.
Also, mentions different implementation Jersey, CXF, among others, so it reach a wider crowd for any doubts and details on these implementations. While in the client side has references to JAXB, Amazon, XStream, Axis.
SOAP Handler, using JAX-WS handlers, shows examples in how an incoming/outcoming SOAP message can be handled to implement business logic in the middle of the conversation; very useful for some security constraint inside of a typical workflow.
Last, but not Least, Security, another important tier on WS, it is covered with simple JAAS and SSL (or better said HTTPS), WS-Security.
Interesting is to mention several (perhaps most important) Java Application Servers, because most examples are using Tomcat, however take time and space to describe tips on Source code, which is available to be downloaded from Git directly.
At the end, similar to the first edition, a not-so deep introduction the current de facto spec for webservices, giving a compass a quick answer about it.
Small and easy to read, not a cookbook, although several examples could be considered recipes.
Bottom Line Yes, I would recommend this to a friend