views:

24

answers:

2

Hi guys is there a way to self-host a web service in Java just like WCF?

A: 

If by self-hosting you mean generating a web service endpoint for invocation, there are a number of ways to go on this, depending on your potential deployment environment.

I'd start off looking at Oracle's JAX-WS implementation, which includes RESTful capabilities. If you want to run a relatively simple stack, you could use Apache Axis2. And then JBoss has JBossWS, which can run standalone or in the JBoss Application Server. I'm pretty sure most of the major application server engines have a Web Services component as well.

mlschechter
What I mean is that on my own application that will not run on any java application server like JBOSS, will be able to host my own web service ready for client consumptions.
powerbox
I apologize for missing that. My understanding is that any of the web service frameworks in Java will need something that is a web listener for your service(s). Matt's example used Grizzly, and the Axis references a servlet container (like Tomcat). Glad you got your answer!
mlschechter
A: 

Jersey using Grizzly embedded within it would seem like a good fit for your needs. It wouldn't require and outside application server and would be fairly lightweight to get setup. You can just read the Jersey getting started documents to get going with that exact path: Jersey User Guide

Matt
Thanks. I just need this as an alternative to WCF and gSOAP.
powerbox