wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes inheriting a @WebMethod from a parent class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "inheriting a @WebMethod from a parent class." Watch "inheriting a @WebMethod from a parent class." New topic
Author

inheriting a @WebMethod from a parent class.

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 724
According to MZ's notes:


The BeanImp inherits the superMethod1 and this superMethod1 will be exposed as a web method.

But what if BeanImp wants to override superMethod1, but does not want to expose it as a web method ?
Noni Singh
Greenhorn

Joined: Feb 09, 2011
Posts: 20
If I'm getting you question correctly, just add @WebMethod annotation w/ exclude=true to the sub class method you want to hide. See below


OCP JSE 5 Programmer, OCE JPAD, OCE WSD6
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 724
Thanks. That is one of the solution.
But I want BeanImp class to inherit the superMethod1() in Base class. I don't want to override superMethod1() in BeanImpl.
Jurica Krizanic
Ranch Hand

Joined: Dec 11, 2008
Posts: 38

If I understand, you don't want to expose superMethod1() as a web method in your BeanImp, and you don't want to change the implementation in the BeanImp?!

As far as I know, you can do what Noni Singh said and call the super method from inherited one! I believe in that way the method in BeanImp will not be exposed as a web method,
and you will get the complete implementation of the superMethod1() from the Base class.



Sorry if I misinterpreted the question.

Jurica Krizanic - Java developer, OCPJP6, Spring Core certified developer!
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 724
Thanks. I got it. Use super.superMethod1() to inherit the parent's method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inheriting a @WebMethod from a parent class.
 
Similar Threads
EJB with Webservice and Remote client view
@WebMethod rules
@WebMethod annotation
Can SIB have multiple SEI?
Exposing ws methods