aspose file tools*
The moose likes Web Services and the fly likes standalone vs container REST service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "standalone vs container REST service" Watch "standalone vs container REST service" New topic
Author

standalone vs container REST service

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
Though the question pertains to REST,it will apply to any service as such.
I have come across fragments of information spread across but never a good design debate.


What advantage do I get publishing the service as a standalone endpoint vs hosting it in a container.
This is more relevant to REST where the primary medium of communication is HTTP,rather than SOAP - thus taking some certificate based QoS convenience out of the picture.

This is a broad question;but would appreciate some insightful opinions and write-ups.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
It's not clear to me what you're asking. Any service will (if implemented in Java) be running on a JVM - are you asking whether that JVM should be used for a servlet container, or for an app server, or just be a one-off solution that runs nothing but your service(s)?

If that's the question then I'd say go with the least amount of work - which is probably a servlet container. Drop in your favorite SOAP/REST framework -which is likely to be a web app anyway-, deploy the service and be done. Rolling your own is way more work.


Ping & DNS - my free Android networking tools app
Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
The question is much more simpler and elementary - sorry if I got this confused.
Why would i decide to make a RESTful service as a stand alone Java app or a web app inside a container.

Particularly for a HTTP based REST,I needed some insights on what I stand to gain or lose if i go either way.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
Yes, that's what I understood the question to be, so my answer applies in full.

Unless you want to roll your own REST framework that doesn't rely on the servlet API, but why would you?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Particularly for a HTTP based REST,I needed some insights on what I stand to gain or lose if i go either way.


The REST concept was originally conceived of as only meaningful for HTTP - see Fielding's original dissertation.

Since you need a HTTP hosting environment the question of a standalone app simply does not arise.

There are plenty of servlet containers besides Tomcat so you have a big spectrum to choose from.

Is this all just speculation or are you actually looking into creating a service?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: standalone vs container REST service