Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between @WebService and @WebServiceProvider

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Srikanth.
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic