28 Publishing a Web Service Endpoint
javax.xml.ws.Endpoint
API. For more information, see http://docs.oracle.com/javase/8/docs/api/javax/xml/ws/Endpoint.html
.
The following table summarizes the steps to publish a web service endpoint.
Table 28-1 Steps to Publish a Web Service Endpoint
# | Step | Description |
---|---|---|
1 |
Create a web service endpoint. |
Use the For example, the following example creates a web service endpoint for the Endpoint callbackImpl = Endpoint.create(new CallbackWS()); |
2 |
Publish the web service endpoint to accept incoming requests. |
Use the Note: If you wish to update the metadata documents (WSDL or XML schema) associated with the endpoint, you must do so before publishing the endpoint. For example, the following example publishes the web service endpoint created in Step 1 using the server context. Object sc context.getMessageContext().get(MessageContext.SERVLET_CONTEXT); callbackImpl.publish(sc); |
3 |
Stop the web service endpoint to shut it down and prevent additional requests after processing is complete. |
Use the For example: callbackImpl.stop() |
For an example of publishing a web service endpoint within the context of a callback example, see Programming Guidelines for the Callback Client Web Service.
In addition to the steps described in the previous table, you can defined the following using the javax.xml.ws.Endpoint
API methods:
-
Endpoint metadata documents (WSDL or XML schema) associated with the endpoint. You must define metadata before publishing the web service endpoint.
-
Endpoint properties.
-
java.util.concurrent.Executor
that will be used to dispatch incoming requests to the application (seehttp://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html
).
For more information, see the javax.xml.ws.Endpoint
Javadoc at http://docs.oracle.com/javase/8/docs/api/javax/xml/ws/Endpoint.html
.