File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Endpoint class and @WebMethod Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Endpoint class and @WebMethod" Watch "Endpoint class and @WebMethod" New topic

Endpoint class and @WebMethod

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 781
In Ivan's notes, p. 150, it says about service endpoint class (annotated with @WebService) "Web service methods must be annotated with @WebMethod , except in the case when all elements of the @WebMethod annotation have the default values."

But in MZ's version 5 notes chapter 4, it says if we have this and SIB with this @WebService (endpointInterface="xxx"), the class must not have @WebMethod.
Secondly, if an SIB does not reference to any SEI and no @WebMethod is specified, all public methods and inherited methods are exposed excluding those methods inherited from Object.

Do the statement in Ivan's note contradict with those in MZ's notes?
"Web service method must be annotated with @WebMethod" ? But if an SIB does not have any @WebMethod methods, that means all public methods are web service methods.
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 781
To answer my own questions, I read MZ's version 6 notes p.17 about exposed methods.
According to MZ, the new interpretation after JAX-WS 2.1.6, if there is a SIB with implicit SEI, all public methods and inherited methods are exposed as web service methods regardless they are annotated with @WebMethod or not.
But before JAX-WS 2.1.6, the legacy interpretation in the same SIB, only those with @WebMethod are exposed as web method.

So, in Ivan's notes, he is refering to the legacy one.
I agree. Here's the link:
subject: Endpoint class and @WebMethod