You just need to annotate - Creating webservices with Java
I have to admit... I can write a webservice(server) in .Net(with attributes) but not in Java. Why? Because writing one seems so hard... Ah ah ah! That was before! Because of this anxiety I tried to key in google for "webservice annotation" and my expectation for Java didn't fail me. My first hit was this article. It's good to know that creating a webservice in Java now(or was it since 2004?) only requires a few annotations.
One example provided in the article I've mentioned look like this:
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService
public class HelloWorldService {
@WebMethod
public String helloWorld() {
return "Hello World!";
}
}
It's all good. Ehem, ehem, ehem. :)