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.
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.
Joined: Mar 09, 2006
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.
Joined: Mar 22, 2005
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?