Lesson 33Working with RESTful Web Services
In the 1990s the web became widely used, and newly created web applications were consumed by millions of people around the world. At the same time lots of legacy applications were available for use only within corporate walls. They were written in a variety of programming languages and deployed on many types of hardware. There was a need to expose corporate data to wider audiences, which resulted in the creation of the standard interface for consuming data over the web.
The difference between traditional JSP/Servlet/JSF web applications and Web Services is that the latter offer just the data and have no interest in what the client’s user interface (UI) looks like. For example, an insurance company could offer information about its products, or a mutual fund could expose its data as a Web Service returning XML documents. Clients didn’t need to know that this insurance company was running its applications using a server from Oracle or that the mutual fund was running on mainframe computers from IBM.
Java EE includes specification for two different implementations of Web Services—JAX-WS and JAX-RS, which I discuss next. Take another look at the sample architectural diagram in Lesson 25 and notice that I put these APIs in two places—one in the Presentation tier and another in the Data tier. Just think of Web Services as a mechanism to expose useful data that can be retrieved using HTTP requests.
Thousands of publicly available Web Services ...
Get Java Programming 24-Hour Trainer, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.