Embedded web server with native @WebService support as an alternative to Endpoint.publish

I spent some time researching what Endpoint.publish may and may not do, and it seems that you are entering very undocumented territory very quickly.

If you create a simple standalone application that exposes one or more annotated @WebService classes using Endpoint.publish, and then you are faced with a situation where you can no longer use Endpoint.publish (for some reason), which is then the easiest way migration?

I know that you can create a WAR using sun-jaxws.xml and possibly Metro banks, which can then be deployed to an embedded web server (like Jetty or Winstone), but I like the simple "take this class and expose its on the IT url "API Endpoint.publish () without any XML or full containers.

Is there a good way to do this?

+7
source share
1 answer

It has been said that you can use an instance of com.sun.net.httpserver.HttpServer to configure the behavior of the HTTP endpoint. It is always useful to be careful with the com.sun , but this may be appropriate depending on your situation. There is an HttpsServer subclass that can be used to provide SSL, for example.

The process is as follows:

When done, use endpoint.stop and server.stop to close.

There is also a blogs.oracle.com entry describing the creation of custom network transports. I did not have enough details to get an excellent understanding from a quick scan, but maybe you can get more from it.

0
source

All Articles