Dan Drillich wrote:Apparently the JSR-181 specification went through some changes as we can see at WebService / WebMethod rules changed in latest spec -
The JSR-181 specification has a change that defines the rules for when a method should be exposed as a Web method.
--- JSR-181 v0.9.2 (Dec '04)
If the implementation bean does not implement a service endpoint
interface, it must include @WebMethod annotations on each method that is
to be exposed as a Web Service operation. More information on the
@WebMethod annotation may be found in section 5.2.
--- JSR-181 v1.0 (June '05)
If the implementation bean does not implement a service endpoint
interface, all public methods other than those inherited from
java.lang.Object will be exposed as Web Service operations. This
behavior can be overridden by using the WebMethod annotation to specify
explicitly those public methods that are to be exposed. If a WebMethod
annotation is present, only the methods to which it is applied are
exposed.
Regards,
Dan
Well, I'm concerning that highlighted in
red not true any more: With JAX-WS 2.2 implementation, all public methods are
always exposed (unless attribute 'exclude=false'), even if I put @WebMethod on some public method.
Before, AFAK, there was a behaviour:
a) by default all public methods are exposed
b) if at least one @WebMethod annotation present, then only those methods exposed which have @WebMethod, and other public methods are not exposed.
New rule also violates JSR-250:
In addition to affecting the annotated class, class-level annotations may act as a
shorthand for member-level annotations. If a member carries a specific member-
level annotation, any annotations of the same type implied by a class-level
annotation are ignored. In other words, explicit member-level annotations have
priority over member-level annotations implied by a class-level annotation. For
example, a @WebService annotation on a class implies that all the public
method in the class that it is applied on are annotated with @WebMethod if there
is no @WebMethod annotation on any of the methods. However if there is a
@WebMethod annotation on any method then the @WebService does not imply
the presence of @WebMethod on the other public methods in the class.
Any comments ?
Best regards,
MZ