Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Difference between @WebService and @WebServiceProvider

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What is the difference between @WebService annotation and @WebServiceProvider annotation.

Thanks,
Srikanth.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Saathvik,

Did you get to know what is the difference between the two?
When do you use 1 over the other?

Regards,
Chetan Shinde
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I found the answer for it on another post,the webservice certification

webpage

But then I had a question, a basic if I am marking a method as @WebService and have multiple methods defined in it, how do I send request to different methods in this @WebService? Ok, the endpoint address that is defined is for the entire class, and as long as the class has the methods marked as WebMethods, with the exclude attribute absent it can be accessed as a normal class method in the client.

Hope my understanding is right.
 
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!
If you annotate an endpoint implementation class with @WebService, then operations will be generated for all the public methods that are not annotated with a @WebMethod annotation which has the exclude attribute set to true.
This can be tested in a very siple manner: Develop an endpoint implementation class that is annotated with @WebService and add some methods in it. Deploy the project to, for instance, GlassFish and then examine the generated WSDL. Annotate one or more methods with @WebMethod(exclude=true) and deploy again etc.
Best wishes!
reply
    Bookmark Topic Watch Topic
  • New Topic