Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST versus SOAP and versus simple website, etc

I'm starting in the web-services world and I have a few questions:

  • From what I've read, REST could be understood as a simple call to a URL which gives a certain expected result. So, what is the difference between a REST web-service and a simple website?

  • Web-services are language-independent. So, if I'm developing a Java-based REST web-service with a method that returns a serialized Person class object, and my client is a .NET application, how can this class be reconstructed on the .NET side? How is it done in practice? Do I have to build a representation of the returned object on the web-service and on the .NET side parse it and build it?

  • In practice, whats is the difference between REST and SOAP calls?

like image 276
producted Avatar asked Oct 16 '10 16:10

producted


People also ask

What is difference between REST Web service and SOAP web service?

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 Web API SOAP or REST?

SOAP APIs are designed with the capability to create, update, recover and delete records such as passwords, leads, accounts, and custom objects. While Web API in the time of Web 1.0 was synonymous with SOAP-based web services, today in Web 2.0, the term SOAP is edging towards REST-style web resources.

What is difference between REST API and simple API?

3) API vs REST API: Protocol The primary goal of API is to standardize data exchange between web services. Depending on the type of API, the choice of protocol changes. On the other hand, REST API is an architectural style for building web services that interact via an HTTP protocol.


2 Answers

See the Richardson Maturity Model for an explanation on what a RESTful service is.

alt text

To reach level 3 one must satisfy the Hypermedia as the Engine of Application State. abrivated HATEOAS constraint (also called the Hypermedia constraint). This means that most services out there is not RESTful, but merly CRUD services... which is fine...

A good resource on REST is REST in Practice

The main difference between SOAP and REST is that REST services does not have a WSDL defining the "operations", thank god for that. Yet the data structures can be defined by a schema language such as Schematron, XSD for XML...

like image 102
TTMAN Avatar answered Oct 14 '22 04:10

TTMAN


REST stands for Representative State Transfer. It is built on the fact that the HTTP protocol is stateless, and specifies some methods like PUT/GET/POST etc. REST attaches semantics to those methods. For example, a GET means 'Read/Load'. PUT means 'save'. POST means 'update'. (I think I got that right...)

So REST is not a call to a URL, REST is a concept. You use REST by making calls to Urls. The difference between REST and a 'simple website' is the REST semantics. A PUT request means one thing, a GET request means another, etc.

RESTful webservices are language independent because the depend on the HTTP protocol; thats it. They don't depend on any language features, other than the ability to use the HTTP protocol.

like image 35
hvgotcodes Avatar answered Oct 14 '22 04:10

hvgotcodes