Java Webservice multithreaded

To have a JAX-WS Webservice in Java 6 or higher with multiple threads, it is necessary to assign an corresponding Executor to the endpoint (the sample uses 5 threads). import java.util.concurrent.Executors; import; import; import; httpServer = HttpServer.create(new InetSocketAddress(interfaceName, port), 0); HttpContext httpContext = httpServer.createContext("/path"); Endpoint endpoint = Endpoint.create(serviceImpl); endpoint.setExecutor(Executors.newFixedThreadPool(5)); endpoint.publish(httpContext);