@WebService
public interface HelloWorld {
@WebMethod
String sayHello(String name);
}
@WebService(endpointInterface = "com.example.HelloWorld")
public class HelloWorldImpl implements HelloWorld {
@Override
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}
public class HelloWorldPublisher {
public static void main(String[] args) {
HelloWorldImpl helloWorld = new HelloWorldImpl();
Endpoint.publish("http://localhost:8080/hello", helloWorld);
}
}