The program is simple. Running the program will send the message to the queue. If the
JmsListenerSample class is still running (or you can run it now), you will get the message with the
following output:
INFO : com.apress.prospring3.ch16.jms.listener.SimpleMessageListener ­ Message received:
Clarence testing JMS message
In real life, the message will most likely be in XML format, representing a piece of business
information (for example, an online order, transaction, booking, and so on).
This section covers only the basic usage scenarios of JMS. For details, please refer to the online JEE
tutorial at http://docs.oracle.com/javaee/5/tutorial/doc/bncdq.html.
Using RESTful-WS in Spring
Nowadays, RESTful-WS is perhaps the most widely used technology for remote access. From remote
service invocation via HTTP to supporting an Ajax-style interactive web frontend, RESTful-WS is being
adopted intensively.
There are a number of reasons for the popularity of RESTful web services:
Easy to understand: RESTful web services are designed around the HTTP protocol.
·
The URL, together with the HTTP method, specifies the intention of the request.
For example, the URL http://somedomain.com/restful/customer/1 with an HTTP
method of GET means that the client wants to retrieve the customer information
where the customer ID equals 1.
Lightweight: RESTful is much more lightweight when compared to SOAP-based
·
web services, which include a large amount of metadata to describe which service
the client wants to invoke. For a RESTful request and response, it's simply an
HTTP request and response like any other web application.
Firewall friendly: Because RESTful web services are designed to be accessed via
·
HTTP (or HTTPS), the application becomes much more firewall friendly and easily
accessed by remote clients.
In this section, we will discuss the basic concepts of RESTful-WS and Spring's support of RESTful-WS
through its Spring MVC module.
Introducing RESTful Web Services
The REST in RESTful-WS is short for REpresentational State Transfer, which is an architectural style.
REST defines a set of architectural constraints that together describe a "uniform interface" for accessing
resources.
The main concepts of the "uniform interface" include the identification of resources and the
manipulation of resources through representations.
For the identification of resources, a piece of information should be accessible via a Uniform
Resource Identifier (URI). For example, the URL http://www.somedomain.com/api/contact/1 is a URI that
represents a resource, which is a piece of contact information with an identifier of 1. If the contact with
an identifier of 1 does not exist, the client will get a 404 HTTP error, just like a page not found in a web
site. Another example, http://www.somedomain.com/api/contacts, is a URI that represents a resourcethat
is a list of contact information.
Those identifiable resources will be able to be managed through various representations, as shown
in Table 16-3.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home