12

Is there any Java library allowing to build a simple standalone webservice server without any application server framework?

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
jumar
  • 5,360
  • 8
  • 46
  • 42

4 Answers4

13

Java 6 contains JAX-WS, which makes it very easy to host a web service in a stand-alone application:

javax.xml.ws.Endpoint.publish("http://localhost:8000/myService/", myServiceImplementation);
Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
  • That's pretty cool, but is there a servlet equivalent, so I can run without a application server? – ggb667 Apr 17 '14 at 14:01
  • @GGB667: that's pretty much an entirely separate question, please ask that as a separate question (or better yet: search for it, I wouldn't be surprised if SO already had an answer for that). – Joachim Sauer Apr 18 '14 at 19:30
  • I couldn't find a nice one-liner like that, but found various tools that can be combined to create one with some work, nothing that elegant. : – ggb667 Apr 30 '14 at 21:16
  • https://www.ibm.com/developerworks/webservices/tutorials/ws-jse/ – Vijay Apr 12 '15 at 05:19
  • I've seen your answer, tried it, but gut stuck reading details of the request, could you please have a look here http://stackoverflow.com/q/37256836/4142984 to clear my confusion or to add more info? Thanks in advance! – Gyro Gearloose May 17 '16 at 16:36
5

Axis 2 has a simple standalone server (see http://ws.apache.org/axis2/1_4_1/installationguide.html)

Vinze
  • 2,549
  • 3
  • 22
  • 23
2

Simple is the fastest and lightest NIO web server you will find in the Java world. About twice as fast as Jetty and a quarter the size.

ng.
  • 7,099
  • 1
  • 38
  • 42
1

Jetty can be run embedded in a java application. Have a look at it.

erdemlal
  • 491
  • 5
  • 21
maskefjes
  • 340
  • 1
  • 3
  • 8