Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restful vs Other Web Services

Tags:

rest

What does it make Restful webservices different from the other Web Services like SOAP?

like image 578
firefox784 Avatar asked Feb 18 '10 01:02

firefox784


People also ask

What is difference between web services and RESTful web services?

Web services are a type of API, which must be accessed through a network connection. REST APIs are a standardized architecture for building web APIs using HTTP methods.

What is differences between RESTful web services and SOAP web services?

REST is a set of guidelines that offers flexible implementation, whereas SOAP is a protocol with specific requirements like XML messaging. REST APIs are lightweight, making them ideal for newer contexts like the Internet of Things (IoT), mobile application development, and serverless computing.

Is there anything better than REST API?

GraphQL solves both over-fetching and under-fetching issues by allowing the client to request only the needed data; Since the client now has more freedom in the fetched data, development is much faster with GraphQL than what it would be with REST.


2 Answers

The debate over web services is by no means complete, but there are some elements that stand out.

RESTful web services are a 'family' of web services. Some would call it an architecture.

RESTful web services use the HTTP protocol to perform requests from a web service. They use the HTTP verbs: GET, POST, PUT and DELETE (and others, sometimes). The requests themselves are to URLs which represent resources... sometimes the requests will contain data in the body that could by HTML, JSON, binary data or other.

A purely RESTful web service only requires the URL and the HTTP verb to describe the requested action... the body data is usually a payload to be involved in the requested action... it should not dictate the requested action

SOAP, on the other hand, is actually a protocol. It is usually transported over HTTP, but the HTTP request is just a method to get the SOAP packet to the necessary handler. The contents of the SOAP request describes what the client wants performed. It contains all the necessary information.

They are two very different ways of implementing Web Services. If you ask the question "Which is better" you'll probably get strong opinions from both sides. I suggest you investigate further and make up your own mind.

like image 124
Dancrumb Avatar answered Jan 20 '23 04:01

Dancrumb


A RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought about as a collection of resources. The definition of such a web service can be thought of as comprising three aspects:

  • The base URI for the web service, such as http://example.com/resources/
  • The MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type.
  • The set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE).

SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on eXtensible Markup Language (XML) as its message format, and usually relies on other Application Layer protocols (most notably Remote Procedure Call (RPC) and HTTP) for message negotiation and transmission. This XML based protocol consists of three parts:

  • an envelope - which defines what is in the message and how to process it -
  • a set of encoding rules for expressing instances of application-defined datatypes,
  • and a convention for representing procedure calls and responses.

references:

  • http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services
  • http://en.wikipedia.org/wiki/SOAP

By the way, a simple google search could provide answers for you...

like image 27
eKek0 Avatar answered Jan 20 '23 06:01

eKek0