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.