aspose file tools*
The moose likes Web Services and the fly likes What is the need of Restful services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "What is the need of Restful services" Watch "What is the need of Restful services" New topic
Author

What is the need of Restful services

Dilip Ganesh
Greenhorn

Joined: Sep 30, 2011
Posts: 24
Hi to all,

I have a question about Restful web services. Servlet also can generate the response as a XML or JSON , servlet can also work on HTTP methods.

So what is the need of Restful web services using the servlet also we can achieve right?

Please give me some real world examples

Thanks

Dilip
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
RESTful web service is an architectural pattern.
A convenient way to implement it in the java world is using servlets, since both cater to the HTTP protocol.
But it's not the only way. RESTful services can exist outside a servlet container, unlike servlets...it is possible to implement them using plain sockets and deploy them standalone.

Dilip Ganesh
Greenhorn

Joined: Sep 30, 2011
Posts: 24
Thank you for your reply.

Karthik Shiraly wrote: RESTful services can exist outside a servlet container, unlike servlets...it is possible to implement them using plain sockets and deploy them standalone.


How it is possible with out using the container implement the restful services?

Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
I didn't get your question. Are you asking how is it possible in principle, or are you asking how to do it using some specific framework?
In principle, as already mentioned, a standalone process can bind to some port using sockets, receive RESTful HTTP requests on it, and reply back with HTTP responses.
A framework like Jersey already supports this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the need of Restful services