• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Doubt in @Webmethod annotation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is advised that 'exclude=true' on @Webmethod not to be used if there is an SE Interface Declared. It can be done though and if done, the method is excluded. So, why is it advised so?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
First of all, where have you read such an advice?
If it is in the Java SE API documentation of the annotation, then it only says:

This member-value is not allowed on endpoint interfaces.


Thus, it does not advice against using the @WebMethod annotation, just saying that it is not allowed on interfaces that endpoint implementation classes implement.

A possible reason for recommending not to use the @WebMethod annotation is that there is little reason in declaring a method in an endpoint implementation class public and then annotate it with @WebMethod(exclude="true").
If you have a method that is public in an endpoint implementation class and it is not used in the web service but it is called from another part of the system, then there may be reasons to consider separation of concerns and have two different service implementation classes.
Best wishes!
 
reply
    Bookmark Topic Watch Topic
  • New Topic