Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Martin Kalin

Rating No ratings yet

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.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on, code-first guide to building and consuming both REST-style and SOAP-based web services in Java, ideal for developers who want working examples they can compile, deploy, and run rather than abstract theory. 【Book Arc】 - **Opening (~0%–10%)**: Frames why web services matter—automating web data access and integrating disparate/legacy systems—and contrasts REST vs. SOAP, SOA vs. older DOA approaches, plus HTTP, XML, and JSON fundamentals. - **Early (~10%–32%)**: Builds the first working RESTful service (a JSP script with backend POJOs), introduces Java HTTP clients, the curl utility, and practical setup of Tomcat and an Ant build/deploy script. - **Middle (~32%–55%)**: Dives into the service side—HttpServlet, JAX-RS (Jersey), Restlet, and @WebServiceProvider APIs—showing how to generate XML and JSON payloads and implement full CRUD operations. - **Late (~55%–85%)**: Moves to SOAP-based services with JAX-WS, covering handlers, faults, binary data, the transport level, and Axis2, plus client-to-service flows and signature verification. - **Ending (~85%–100%)**: Addresses web services security—wire-level HTTPS, encryption, the HTTPS handshake, container-managed security, and enforcing secure access to services. 【Key Takeaways】 - **REST and SOAP are complementary, not competing** (Opening): the book deliberately avoids crowning one "best" approach, instead clarifying when each fits your service's needs. - **HTTP is the backbone of RESTful design** (Early): URIs are opaque identifiers, and verbs like GET/POST map naturally onto servlet do-methods, shaping how you model resources. - **Multiple Java APIs solve the same problem** (Middle): HttpServlet, JAX-RS/Jersey, Restlet, and @WebServiceProvider each offer distinct trade-offs for publishing RESTful services. - **JSP scripts vs. servlets is a real decision** (Middle): JSP is convenient for experimentation since the server compiles it, but explicit HttpServlet subclasses are best practice for production. - **CRUD operations anchor service examples** (Middle): sorting Prediction objects makes it easy to verify that POST, PUT, and DELETE behave correctly against a ConcurrentMap store. - **SOAP adds layers REST lacks** (Late): handlers, fault levels, and binary-data transport give SOAP-based services structured error handling and extensibility. - **Security is a first-class concern** (Ending): HTTPS provides confidentiality, integrity, and authentication via its handshake, and container-managed security enforces access control. - **Tooling matters as much as code** (Early): Tomcat (with its Catalina container) and the provided Ant script handle compiling, packaging, and deploying WAR files. 【Reading Tips】 - **Deep-read Chapters 1–2** if you're new to web services; they establish HTTP, REST, and the servlet model that everything else builds on. - **Skim the API survey** in Chapter 2 if you already know one framework—focus on the one you'll actually use (JAX-RS/Jersey is the most emphasized). - **Treat code examples as the spine**: compile and run them rather than reading passively; the Ant script and Tomcat setup are part of the learning. - **Save the security chapter for last** but don't skip it—HTTPS and container-managed security are where production readiness lives. - **Watch the REST/SOAP balance**: the second edition leans REST-heavy, so SOAP readers should budget extra time for the later chapters. 【Coverage Limits】 This guide is synthesized from stratified excerpts covering the preface, table of contents, and portions of Chapters 1–2; later chapters (SOAP handlers, security details) are represented mainly through headings and summaries, so specific code and figures there are not fully covered.
Page 7
rvice 212 A Handler Chain with Two Handlers 213 SOAP-Based Web Services and Binary Data 218 The Transport Level 224 Axis2 227 What’s Next? 229 6. Web Service...
View in text
Excerpt 2
t, is dedicated to Janet. Preface | xvii www.it-ebooks.info A visit to a website such as the Amazon E-Commerce site is often interactive: a shopper uses a br...
View in text
Excerpt 3
null; while ((next_record = reader.readLine()) != null) System.out.println(next_record); // Close. reader.close(); } catch(MalformedURLException e) { throw n...
View in text
Excerpt 4
ions has changed as well (see Example 2-2). As explained in the sidebar about thread synchronization and servlets, the Map of the earlier JSP imple‐ mentatio...
View in text
Excerpt 5
support a plain-text representation of a predictions list. The RestfulPrediction class (see Example 2-8) is the JAX-RS Application class. To ensure that the...
View in text
Excerpt 6
PAYLOAD (the body, if any, of the request message). The ad‐ ages3 service needs access to both the HTTP headers and, for POST and PUT requests, the HTTP body...
View in text
Excerpt 7
ges for Java-to-XML conversions and XML-to-JSON conversions. There are also various contributed libraries, among them XStream. This section examines the XStr...
View in text
Excerpt 8
gment also gives the MIME types of the request (line 3) and the response (line 4): the request type application/x-www-form-urlencoded specifies a URL-encoded...
View in text
Tags
AI categories
JavaWeb TechnologyBackend
ISBN: 1449365116
Publisher: O'Reilly Media
Publish Year: 2013
Language: English
Pages: 360
File Format: PDF
File Size: 10.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…