A Framework-less Java SOAP Service

I’m a heavy user of Apache CXF which uses Spring for configuration. I’m a big fan of it’s customisability and feature-richness, but sometimes in a sea of features we forget how simple things can be! So now I’m currently writing some training material on JAX-WS and have been trying to create a simple 1 slide example of a SOAP Service. Here goes:

package uk.co.mattgoldspink;
import javax.jws.*;
@WebService
public class HelloService {
 @WebMethod
 public String greet(@WebParam String request)
 {
 return "Hello, " + request;
 }
 public static void main(String[] args)
 {

 new HelloService());
 }
}

That’s it! Just a JDK required.

Leave a Reply