What is ODATA ? What is SOAP,REST,HTTP ? Advantages of REST over SOAP (Step-by-Step)

What is ODATA, What is HTTP(Hyper Text Transfer Protocol)?

HTTP is the protocol i.e. a set of rules on which OData is based & also one of the most common language being spoken on the Internet.

You can request for any document located somewhere on this globe by providing its address via your PC or mobile browser which sends HTTP requests to the web server. The Web server then returns back the HTTP response i.e. resolved by the Web Browser for you to view the document on your PC machine.

HTTP is based on Client-Server architecture and it uses a stateless request/response protocol to communicate between the client & a web server.

Why stateless?

Every single HTTP request which is received by the web server is forgotten or lost after a response has been sent across. A web servers generally do not process an HTTP request by remembering the old request that has been sent. It doesn’t remember the request being sent.

Read More: Odata service structure 

HTTP Codes:

1xx: Informational
It means the request had been received & the process is continuing.
2xx: Success
It means the action was successfully received, understood, & accepted.
3xx: Redirection
It means further action must be taken in order to complete the users’ request.
4xx: Client Error
It means the users request contains incorrect syntax or cannot be fulfilled.
5xx: Server Error
It means the server failed to serve a valid request.

What is ODATA?

What is a protocol->It is a set of rules.

OData is a REST-based protocol released under the Microsoft Open Specification Promise (OSP) for querying and updating data and is built on standardized technologies such as HTTP, Atom/XML, and JSON. Microsoft originally developed and introduced OData. Now OData is owned and maintained by the Oasis organisation.

What Is REST?

A term that you frequently come across when talking about OData is Representational State Transfer (REST). OData requests use the REST model, which was introduced in 2000 by Roy Fielding in his PhD dissertation.
An architecture is called RESTful if it complies with six architectural constraints:

  • Client server architecture
    A uniform interface separates clients from servers, resulting in a separation of concern.
  • Statelessness
    No context is stored on the server between requests. Any request from a client contains all required information to service the request.
  • Cacheability
    Responses have to define themselves as cacheable or not cacheable to prevent clients from using stale or inappropriate data in response to additional, later requests.
  • Layered system
    A client can’t tell whether it’s connected directly to the end server or to a server along the way.
  • Uniform interface
    A uniform interface between clients and servers decouples the architecture.
  • Code on demand
    Servers can temporarily extend or customize the functionality of a client by transferring executable code. This constraint is actually optional.

Each REST command is a request of one of the following types, informing the server from the client to perform one of the following operations on the server:

  • GET
    Get a single entry or a collection of entries.
  • POST
    Create a new entry.
  • PUT
    Update an existing entry.
  • DELETE
    Remove an entry.
  • PATCH
    Update single properties of an existing entry.

Note
A common misconception is to think about REST as some kind of protocol,
such as HTTP or Simple Object Access Protocol (SOAP). This is incorrect—
REST is a development paradigm, not a protocol.

Benefits of REST(Representational State Transfer) Over SOAP
  • REST allows a greater variety of data formats, whereas SOAP only allows XML.
  • REST is naturally stateless,
  • Coupled with JSON (which typically works better with data and offers faster parsing), REST is generally considered easier to work with.Thanks to JSON, REST offers better support for browser clients.
  • REST provides superior performance, particularly through caching for information that’s not altered and not dynamic.
  • It is the protocol used most often for major services such as Yahoo, Ebay, Amazon, and even Google.
    REST is generally faster and uses less bandwidth.
Benefits of SOAP((Simple Object Access Protocol) Over REST
  • SOAP has built-in stateful operations.
  • If you need more robust security, SOAP’s support for WS-Security can come in handy. It offers some additional assurances for data privacy and integrity.
  • Another advantage of SOAP is that it offers built-in retry logic to compensate for failed communications.

 

Advertisement

Leave a Comment