Skip to content

Instantly share code, notes, and snippets.

@gliviu
Last active March 12, 2019 22:53
Show Gist options
  • Save gliviu/0c23361a3681bc93659d to your computer and use it in GitHub Desktop.
Save gliviu/0c23361a3681bc93659d to your computer and use it in GitHub Desktop.
Java standalone soap service
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
// http://localhost:8080/helloService?wsdl
// Credits: http://hofmanndavid.blogspot.ro/2008/11/easiest-way-to-publish-java-web.html
@WebService(targetNamespace="namespace")
public class StandaloneHelloSoapService {
public String hello(String name) {
return "Hello " + name + " !";
}
public static void main(String ...args) {
Endpoint.publish("http://localhost:8080/helloService", new StandaloneHelloSoapService());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment