Requirements of JAX-WS Endpoint

Connect with

JAX-WS Endpoint
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

  1. The implementing class for JAX-WS Java web services, must be annotated with either the javax.jws.WebService or the javax.jws.WebServiceProvider annotation.
  2. The implementing class may explicitly reference an SEI through the endpointInterface element of the @WebService annotation but is not required to do so. If no endpointInterface is specified in @WebService, an SEI is implicitly defined for the implementing class.
  3. The business methods of the implementing class must be public and must not be declared static or final.
  4. Business methods that are exposed to web service clients must be annotated with javax.jws.WebMethod.
  5. Business methods that are exposed to web service clients must have JAXB-compatible parameters and return types.
  6. The implementing class must not be declared final and must not be abstract.
  7. The implementing class must have a default public constructor.
  8. The implementing class must not define the
  9. finalize
  10. method.

  11. The implementing class may use the javax.annotation.PostConstruct or the javax.annotation.PreDestroy annotations on its methods for lifecycle event callbacks.

2. Life Cycle callback methods

Usually annotation : @PreDestroy and @PostConstruct can be used for callback.

  • The @PostConstruct method is called by the container before the implementing class begins responding to web service clients.
  • The @PreDestroy method 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! 🙂


Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *