I am trying to expose some Java web services so that I can interoperate from C# (see this SO question). The proof of concept code below works great with WCF!
My question is about the use of the javax.xml.ws.Endpoint
class to publish my service:
- What do I forfeit by going this route instead of a full-blown application server?
- Is this an appropriate solution for long-running service with a low volume of calls?
The following produces WSDL, is cleanly callable from .Net, and performs well. Why wouldn't I use it?
@javax.jws.WebService
public class TestSvc {
@javax.jws.WebMethod()
public String sayHello() {
return "Hello!";
}
}
import javax.xml.ws.Endpoint;
public class Main {
public static void main(String[] args) throws Exception {
Endpoint.publish("http://localhost:8181/Test", new TestSvc());
}
}