REST Assured vs RESTful web services - rest

Is there any difference between REST Assured and RESTful web services?

What is REST?
REST stands for Representational State Transfer, which is an architectural style for distributed hypermedia systems, frequently used to build web services that aim to be lightweight, maintainable and scalable.
The REST architecture was defined by Roy Thomas Fielding in his dissertation and should follow this set of constraints:
Client-server
Stateless
Cache
Uniform interface
Layered system
Code-on-demand
The fundamental concept in a REST architecture is the resource and resources can have different representations. For more details, this answer can be helpful.
It's also worth mentioning that the REST architectural style is protocol independent but it's frequently designed over the HTTP protocol because it is largely adopted and well known.
What is RESTful?
A service based on the REST architecture, following the constraints mentioned above, is called RESTful.
What is REST Assured?
REST Assured is a tool that aims to bring simplicity for testing and validating the response of REST services in Java.

Related

Are RPC frameworks such as Apache Thrift or GRPC or any other RPC framework RESTful?

Just to clarify what I mean by RESTful, it should satisfy the following constraints, taken from here:
Uniform Interface
Stateless
Cacheable
Client-Server
Layered System
Code on Demand
From my research, I believe that they aren't RESTful, primarily because :
They do not use HTTP verbs.
They do not use HTTP Response Codes.
They does not follow principles of REST connectedness which is based on HATEOAS.
Refer this resource for more information about data above conclusions are based on.
Some resources like these seem to suggest these frameworks can be used/implemented as RESTful.
Please refer to resources you're basing your answer on. This question is intended to clear the misconception about the topic strongly citing official resources.
Are RPC frameworks such as Apache Thrift or GRPC or any other RPC framework RESTful?
Taken in isolation: no.
The definitive reference on REST is Architectural Styles and
the Design of Network-based Software Architectures. Roy Fielding describes the architectural constraints that were developed while working on the web standards (RFC 1945, RFC 2068, RFC 2616, later RFC 7230).
REST is intended for long-lived network-based applications that span multiple organizations (Fielding, 2008)
"The World Wide Web" would be an example of an application built using the REST architectural style.
HTTP methods and status-codes are not themselves a REST constraint. In a REST architecture, the client and server share semantics by exchanging messages, but those aren't required to be HTTP messages. You could replace HTTP with another protocol that conforms to the architectural style, and still have a REST architecture.
Some resources like these seem to suggest these frameworks can be used/implemented as RESTful.
People who understand REST to mean HTTP+JSON are going to reach conclusions that are inconsistent with the web architecture and Fielding's thesis.
In short - HTML does a lot of the heavy lifting in making the web architectural style successful. JSON, in contrast, does not include the semantics of a "link" or a "form" that can be used to communicate to the client which transitions are possible. You need some other semantics on top of JSON to allow the server to communicate to the client which application transitions are possible; either Web Linking or a hypermedia aware dialect of JSON.
As far as can tell, you could use Thrift to create an application that satisfies the REST architectural constraints. But my guess is that it wouldn't be a particularly satisfying experience: Thrift was developed because Facebook needed a system with properties that the Web architecture didn't satisfy.
REST is great for the web. Howver, the stack composed of REST, HTTP and JSON is not optimal for high performances required for internal data transfer. Indeed, the serialization and deserialization of these protocols and formats can be prejudicial for overall speed. -- Leo Schoukroun
URI, HTTP, HTML are easily repurposed, but that flexibility comes with costs. In settings where that flexibility doesn't provide value (for instance, because you are a single organization that controls deployment of the client and the server), then more efficient formats and protocols become more interesting.
It's similar to the trade off that we've made between HTML and JSON -- JSON isn't a useful hypermedia representation; but it's perfectly satisfactory for consumption by the code on demand that has been loaded by our hypermedia representation.
Horses for courses.
REST is by definition not RPC, because the most significant distinction of REST is that it is resource oriented, which RPC is (typically) not.
Furthermore, one should refrain from trying to solve problems that are crying for RPC by inventing some "RPC over REST" solution - Programmers SE is full of these kind of questions.
In fact, such an approach would be upside down: One can implement a REST-based system by means of RPC, but the whole idea why one would want to use REST is on a completely different abstraction plane.
So I'd say the question is (sort of) a category mistake.

When can we say a design is completely RESTful?

I am currently studying about REST interfaces for directory services and I'm confused about RESTful interfaces. When can we say that the design is completely RESTful?
The REST architectural style
REST stands for Representational State Transfer. This architecture is protocol independent but it is frequently implemented over the HTTP protocol.
The REST architectural style was defined in the chapter 5 of Roy Thomas Fielding's PhD dissertation. And the following set of constraints was added to this architectural style:
Client-server
Stateless
Cache
Uniform interface
Layered system
Code-on-demand
Through the application of the constraints defined above, certain architectural properties are induced, such as visibility, portability, reliability, scalability and network efficiency.
What does RESTful mean?
The term RESTful could be compared to the term object-oriented. Programming languages could be considered object-oriented when they follow a set of concepts. An application can be considered RESTful when such application does not break the constraints defined above.
REST is a resource-oriented architecture. When implementing REST applications over the HTTP protocol, for example, the resource is identified by the URI and the operation over the resource is expressed by the HTTP method.

Differences RESTEasy and RESTful web services

What is the main differences between restful and resteasy webservices? Have been working with resteasy and it works with jboss. That's all I know.
What is REST?
REST stands for Representational State Transfer, which is an architectural style for distributed hypermedia systems, used to build web services that are lightweight, maintainable, and scalable.
The REST architecture was defined by Roy Thomas Fielding in his dissertation and should follow this set of constraints:
Client-server
Stateless
Cache
Uniform interface
Resources identification
Resources representation
Self-descriptive messages
Hypermedia
Layered system
Code-on-demand
The fundamental concept in a RESTful API is the resource and resources can have different representations. For more details, this answer can be helpful.
It's also worth mentioning that the REST architectural style is protocol independent but it's frequently designed over the HTTP protocol because it's largely adopted.
What is RESTful?
A service based on the REST architecture, following the constraints mentioned above, is called a RESTful service.
What is RESTEasy?
RESTEasy is framework provided by JBoss to create RESTful services in Java. It implements the JAX-RS specification (the Java API for RESTful web services).
RESTful is a term, it means that the actual service fulfills all of the required REST constraints, while RESTEasy is a framework for building REST services.
RESTful term refers to those systems that conform to the constraints of REST.
Java API for RESTful Web Services is JAX-RS.
Different vendors offers their implementation of JAX-RS and RestEasy is one of them:
- Jersey
- Apache CXF
- JBoss RESTEasy
- Wrapping Up

At which point does a SOAP based Webservice not meet the REST Architecture?

There is a huge discussion about Webservices using SOAP and RESTful Webservices. But i don't know precisely at which point does a Webservice which use WSDL, UDDI and SOAP not meet the REST Architecture ?
A REST service is defined by its interface. To be RESTful, it must have:
Identification of resources
Manipulation through representations
Self-descriptive error messages
Hypermedia as the engine of application state
SOAP does a decent job of the first 3, though it does significantly reimplement #2 and #3 so it is more verbose and less stable than relying on HTTP's underlying protocol. Where SOAP really diverges from REST is in #4 - HATEOAS. A properly designed REST service should be fully functional directly in a web browser. Admittedly, most purported "REST" services don't do this either, but it is at least possible. SOAP requires significant tools to use. (SoapUI is a decent one.)
At most of the points. I have a more elaborate answer here. But to be short. I guess you are talking about SOAP webservices with RPC binding style... They are XML/RPC, while REST is REST. There are very specific REST constraints defined here: Architectural Styles and
the Design of Network-based Software Architectures by Roy Fielding.
How a SOAP RPC webservice meets the REST constraints:
client-server architecture - always
stateless - possibly
cache - possibly
uniform interface - never
layered system - never
code on demand (optional) - possibly

REST vs Web Services

In relation to this question, I have a follow up question that I am still confused over. I have been asked to compair REST vs Web Services. From what I have learnt about REST, it is not a web service, therefore how can you compair the two? What does the question mean when it says REST in this respect?
REST is an architectural pattern for web services emphasizing the usage of URIs as resources with a small set of operations that may be performed on them (usually PUT, POST, GET, and DELETE). I'm guessing you are being asked to compare REST to the ws* standard web services which utilize a lot of other technologies (including SOAP, though SOAP itself is not a web service, it is just a protocol that happens to be used in ws* web services).
REST can be used to provide web services just like databases can be used to store names and addresses. REST is far more general purpose than simply a way of providing a web API.
REST is useful for building distributed systems. However, many people use Web Services (note the capitals, this usually denotes SOAP, WS-*) for building distributed systems.
Wow, I just saw the homework tag. That is one seriously mean question. There are industry veterans who could not come close to answering this question.
A more accurate question would be: Compare REST using HTTP versus RPC using SOAP for building distributed systems.
They probably mean REST verse SOAP. They're all web services in concept.
The abbreviation REST stands for "REpresentational State Transfer".
REST APIs are used to call resources and allow the software to communicate based on standardized principles, properties, and constraints. REST APIs operate on a simple request/response system. You can send a request using these HTTP methods.
Hence REST is just an API (an interface that allows you to build on the data and functionality of another application) architectural style.
On the other hand, web service is a network-based resource that fulfills a specific task. Yes, there's overlap between the two: all web services are APIs, but not all APIs are web services.