Skip Headers
Oracle® Fusion Middleware Developing RESTful Web Services for Oracle WebLogic Server
12c Release 1 (12.1.1)

Part Number E24983-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

1 Introduction to RESTful Web Services

This chapter provides an overview of developing WebLogic Web services that conform to the Representational State Transfer (REST) architectural style using Java API for RESTful Web Services (JAX-RS).

This chapter includes the following sections:

Introduction to the REST Architectural Style

REST describes any simple interface that transmits data over a standardized interface (such as HTTP) without an additional messaging layer, such as Simple Object Access Protocol (SOAP). REST is an architectural style—not a toolkit—that provides a set of design rules for creating stateless services that are viewed as resources, or sources of specific information (data and functionality). Each resource can be identified by its unique Uniform Resource Identifiers (URIs).

A client accesses a resource using the URI and a standardized fixed set of methods, and a representation of the resource is returned. A representation of a resource is typically a document that captures the current or intended state of a resource. The client is said to transfer state with each new resource representation.

Table 1-1 defines a set of constraints defined by the REST architectural style that must be adhered to in order for an application to be considered "RESTful."

Table 1-1 Constraints of the REST Architectural Style

Constraint Description

Addressability

Identifies all resources using a uniform resource identifier (URI). In the English language, URIs would be the equivalent of a noun.

Uniform interface

Enables the access of a resource using a uniform interface, such as HTTP methods (GET, POST, PUT, and DELETE). Applying the English language analogy, these methods would be considered verbs, describing the actions that are applicable to the named resource.

Client-server architecture

Separates clients and servers into interface requirements and data storage requirements. This architecture improves portability of the user interface across multiple platforms and scalability by simplifying server components.

Stateless interaction

Uses a stateless communication protocol, typically Hypertext Transport Protocol (HTTP). All requests must contain all of the information required for a particular request. Session state is stored on the client only.

This interactive style improves:

  • Visibility—Single request provides the full details of the request.

  • Reliability—Eases recovery from partial failures.

  • Scalability—Not having to store state enables the server to free resources quickly.

Cacheable

Enables the caching of client responses. Responses must be identified as cacheable or non-cacheable. Caching eliminates some interactions, improving efficiency, scalability, and perceived performance.

Layered system

Enables client to connect to an intermediary server rather than directly to the end server (without the client's knowledge). Use of intermediary servers improve system scalability by offering load balancing and shared caching.


What Are RESTful Web Services?

RESTful Web services are services that are built according to REST principles and, as such, are designed to work well on the Web.

RESTful Web services conform to the architectural style constraints defined in Table 1-1. Typically, RESTful Web services are built on the HTTP protocol and implement operations that map to the common HTTP methods, such as GET, POST, PUT, and DELETE to create, retrieve, update, and delete resources, respectively.

Standards Supported for RESTful Web Service Development on WebLogic Server

The JAX-RS provides support for creating Web services according to REST architectural style. JAX-RS uses annotations to simplify the development of RESTful Web services. By simply adding annotations to your Web service, you can define the resources and the actions that can be performed on those resources. JAX-RS is part of the Java EE 6 full profile, and is integrated with Contexts and Dependency Injection (CDI) for the Java EE Platform (CDI), Enterprise JavaBeans (EJB) technology, and Java Servlet technology.

WebLogic Server supports Jersey 1.9 JAX-RS Reference Implementation (RI), which is a production quality implementation of the JSR-311 JAX-RS 1.1 specification, defined at: http://jcp.org/en/jsr/summary?id=311. As required, you can use a more recent version of the Jersey JAX-RS RI, as described in Appendix A, "Updating the Version of Jersey JAX-RS RI."

The Jersey 1.9 JAX-RS RI bundle includes the following functionality:

For more information about JAX-RS and samples, see Learn More About RESTful Web Services.

Roadmap for Implementing RESTful Web Services

The following table provides a roadmap of common tasks for developing, packaging and deploying, invoking, and monitoring RESTful Web services and clients using WebLogic Server.

Table 1-2 Roadmap for Implementing RESTful Web Services

This chapter . . . Describes how to . . .

Chapter 2, "Developing RESTful Web Services"

Develop RESTful Web services.

Chapter 3, "Packaging and Deploying RESTful Web Services"

Package and deploy RESTful Web services.

Chapter 4, "Developing RESTful Web Service Clients"

Develop clients to invoke the RESTful Web service using the Jersey client API.

Chapter 5, "Securing RESTful Web Services"

Secure RESTful Web services.

Chapter 6, "Monitoring RESTful Web Services"

Monitor RESTful Web services

Appendix A, "Updating the Version of Jersey JAX-RS RI"

Update the version of the Jersey JAX-RS Reference Implementation (RI) used by your RESTful Web service applications.


Upgrading RESTful Web Services from Oracle WebLogic Server 10.3.x to 12.1.x

You can upgrade a RESTful Web service that was built in the Oracle WebLogic Server 11g Release 1 (10.3.x) environment to run in the Oracle WebLogic Server 12c Release 1 (12.1.x) environment. For detailed steps, see "Upgrading a 10.3.x RESTful Web Service (JAX-RS) to 12.1.x" in Upgrade Guide for Oracle WebLogic Server.

Learn More About RESTful Web Services

Table 1-2 provides a list of resources for more information about RESTful Web services.

Table 1-3 Resources for More Information

Resource Link

Jersey 1.9 User Guide

http://jersey.java.net/nonav/documentation/1.9/user-guide.html

RESTful Web Services (JAX-RS) sample

"Sample Application and Code Examples" in Understanding Oracle WebLogic Server

The Java EE 6 Tutorial—Building RESTful Web Services With JAX-RS

http://download.oracle.com/javaee/6/tutorial/doc/giepu.html

Jersey site

http://jersey.java.net

Community Wiki for Project Jersey

http://wikis.sun.com/display/Jersey/Main

Jersey 1.9 API Javadoc

http://jersey.java.net/nonav/apidocs/1.9/jersey/overview-summary.html

JSR-311 JAX-RS Specification

http://jcp.org/en/jsr/summary?id=311

JSR-311 JAX-RS Project

http://jsr311.java.net/

JSR-311 JAX-RS API Javadoc

http://jsr311.java.net/nonav/javadoc/index.html

"Representational State Transfer (REST)" in Architectural Styles and the Design of Network-based Software Architectures (Dissertation by Roy Fielding)

http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm