Sindu Kethan Web Services

Web Services

Views: 218

REpresentational State Tranfer ( REST ) by itself is not an architecture. It defines a set of rules and constrains, when applied while designing an application, create a software architectural style. The application will have peculiar roles defined for data, components, hyperlinks ( URI ), protocols and data consumers on the other side. REST shows a path to develop a distributed application using the networking resources and technologies. A system can be defined as RESTful if it has the following characteristics

  1. A client - server model
  2. Stateless - which means users sessions need not be maintained, independent requests should be made available.
  3. A caching system supportive
  4. Should not be dependent on networking infrastructure
  5. Resources should be defined and accessed using unique URI's
  6. Should be scalable
  7. Should provide code on demand
  8. APIs should be exposed or published.

The following will form the core fundamental blocks  of RESTful web services

  1. Resources ( addressable over the Web )
  2. Data representation ( XML / JSON )
  3. URI ( Uniform Resource Identifiers )
  4. Uniform interfaces through HTTP requests.

Main areas where Web Services deployment is implement worthy

  1. Within companies to support operations.
  2. Expose the API's to the public
  3. Distributed system development where a client can be on a web or a mobile device or cloud access.
  4. A consistent data distribution requirement

Amazon offers its on-demand hosting storage infrastructure using web service. Facebook offers its platforms for targeted marketing and advertising campaigns. Web Service when they are implemented in companies for operations will be used to connect previously disjointed departments within the company. By connecting more than one department to share information using web services, a new system will be put in place by the same Service Oriented Architecture  ( SOA ). The first principle of REST is the idea of using Hypermedia As The Engine of Application Engine ( HATEOAS ). Hypermedia is a document-centric approach with added support for adding links to other services and information.

A brief about JX-RS

  1. JAX-RS framework focusses on applying Java annotations to plain Java objects.
  2. It has annotations to bind specific URI patterns and HTTP operations to the respective and individual methods in the Java resources ( classes ).
  3. It has parameter injection annotation which makes the job easy to pull in the required information from the client accessing the web service.
  4. It has message body headers that allows marshalling and unmarshalling daya from the Java data objects.
  5. It has exception mappers that will map the application thrown exceptions to an HTTP response code and message.

To close this, a one line quote about Web Services would be, " It is an independent computing system that exchanges data in XML / JSON formats with other systems using HTTP as the communication protocol and it implements a single business requirement"

 

Comments: 1

Your email address will not be published. Required fields are marked with *

  1. This blog gives the reader / Java programmer a broader view about Web Services. The jargon used is simple enough & it is technically perfect. I appreciate your time and reading abilities in providing such a good insight into every blog you write. Hoping many more from your end !

PLEASE FOLLOW & LIKE US :)