Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

A RESTful service has to use HTTP

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Coderanch,

In Enthuware Test Studio I've got the following question:
Which of the following statements best describe a RESTful Web Service?
One possible answer is: A RESTful service has to use HTTP
The explaination says that it is not necessarily true.

Can someone explain me, why this is not necessarily true?

I ask some REST-experts and all of them didn't know that

best regards,
Ralf
 
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

REST as defined by Roy Fielding's PhD thesis did not mandate or require HTTP. That said, I am not aware of any REST library that does not use HTTP, nor have I seen a REST WS that was not based on HTTP.
 
Creator of Enthuware JWS+ V6
Posts: 3345
303
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ralf,

What Ulf is saying is correct. Fielding did not write a PhD about HTTP, he wrote a dissertation about RESTful services. He leaves the possibility open to implement REST by protocols other than HTTP. Let me quote him: "REST does not restrict communication to a particular protocol".

This is just one of the (trick) questions that make you think and do some research on the ideas behind REST. It is important (for the exam) to know the architectural principles of REST. In real-life though, REST is always HTTP.

By the way: if you have any questions or doubts about a question in the question bank, you can hit the "discuss" button and you will be redirected to the Enthuware forums. You might get a quicker response there.

Regards,
Frits
 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch !!
this is kind of same as we have in Java Servlets. I have always used HTTP Servlets in my career so far. I have never used FTPServlet or SMTPServlet although java specification do have a way to write such Servlets [for example - extends Generic Servlet and implement required inherited method] .

~ abhay
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have always used HTTP Servlets in my career so far. I have never used FTPServlet or SMTPServlet although java specification do have a way to write such Servlets


Not to derail the topic, but the servlet spec does not enable you to write such servlets. It allows servlet engine implementors to enable this, but none has done so yet. See https://coderanch.com/how-to/java/ServletsFaq#otherProtocols for some information on this. The only other protocol made available for servlets is SIP - probably unknown to most web developers :-)
 
Ralf Muehle
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
many thanks for the explanations
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the correction
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic