This post is about the requirement of JAX-WS endpoint and this is very important to understand the minimum requirements to implement a Java JAX-WS web service.
Everyone either you are implementor or developer or architect or lead or manager of Java web services, you must know JAX-WS requirements. By knowing this, you reach on the conclusion, what you should do and what you should not do. This post is essential for all roles who is concerned about Java web service.
1. JAX-WS endpoints must follow following requirements
Here, you know about JAX-WS
- The implementing class for JAX-WS Java web services, 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.
2. 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.
3. Reference for JAX-WS endpoints
Thanks for visiting this post for the Requirement of JAX-WS endpoint. You can visit JAX-WS web services tutorial page.
Your comments are welcome to improve this post. Happy Learning! 🙂