LibraryLink ToToggle FramesPrintFeedback

APIs Used to Publish a Service

The javax.xml.ws.Enddpoint class does the work of publishing a JAX-WS service provider. To publishing an endpoint do the following:

The Endpoint class provides methods for creating and publishing service providers. It also provides a method that can create and publish a service provider in a single method call.

A service provider is instantiated using an Endpoint object. You instantiate an Endpoint object for your service provider using one of the following methods:

[Important]Important

The implementation object passed to any of the Endpoint creation methods must either be an instance of a class annotated with javax.jws.WebService and meeting the requirements for being an SEI implementation or it must be an instance of a class annotated with javax.xml.ws.WebServiceProvider and implementing the Provider interface.

You can publish a service provider using either of the following Endpoint methods:

When the service provider is no longer needed you should stop it using its stop() method. The stop() method, shown in Example 9.1, shuts down the endpoint and cleans up any resources it is using.


[Important]Important

Once the endpoint is stopped it cannot be republished.