Rules for methods in classes annotated with @WebService
When you use the @WebService annotation, several rules control how methods are exposed in your Web service and how you can use the @WebMethod annotation.
The following rules apply in this situation:
- If the @WebService annotation of an implementation class refers to a Service Endpoint Interface (SEI), the implementation class must have no @WebMethod annotations.
- In an SEI or in an implementation class that does not refer to an SEI, all public methods are treated as exposed, even if the @WebMethod annotation is not specified. The exposed public methods include any inherited methods, except for methods in the Object class.
- In an SEI or in an implementation class that does not refer to an SEI, if a @WebMethod annotation has an attribute of exclude=true, the method is not exposed.
Related reference
Web Services Metadata Annotations (JSR 181)