This post is about the requirement of JAX-WS endpoint and this is very important to understand minimum requirment to implement. Every one (implementor/developer/architect/lead etc..) should know JAX-WS requirement. By knowing this, you can say, what you should do and what you should not do.
JAX-WS endpoints must follow following requirements.
- The implementing class must be annotated with either the
- The implementing class may explicitly reference an SEI through the endpointInterface element of the
@WebServiceannotation but is not required to do so. If no endpointInterface is specified in
@WebService, an SEI is implicitly defined for the implementing class.
- The business methods of the implementing class must be
publicand must not be declared
- Business methods that are exposed to web service clients must be annotated with
- Business methods that are exposed to web service clients must have
JAXB-compatibleparameters and return types.
- The implementing class must not be declared
finaland must not be
- The implementing class must have a default public constructor.
- The implementing class must not define the
- The implementing class may use the
javax.annotation.PreDestroyannotations on its methods for lifecycle event callbacks.
Life Cycle callback methods
Usually annotation :
@PostConstruct can be used for callback.
@PostConstructmethod is called by the container before the implementing class begins responding to web service clients.
@PreDestroymethod is called by the container before the endpoint is removed from operation.
Your comments are welcome to improve this post. Happy Learning 🙂