This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Difference between @WebService and @WebServiceProvider Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Difference between @WebService and @WebServiceProvider" Watch "Difference between @WebService and @WebServiceProvider" New topic
Author

Difference between @WebService and @WebServiceProvider

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

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

Thanks,
Srikanth.
C Shinde
Ranch Hand

Joined: Oct 22, 2009
Posts: 60
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


Regards,
Chetan Shinde
C Shinde
Ranch Hand

Joined: Oct 22, 2009
Posts: 60
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between @WebService and @WebServiceProvider
 
Similar Threads
SOAP message with attachment server-side implementation
Handlers and Providers Interfaces
difference between restful webservice and jersey webservice
Difference between @WebService and @WebServiceProvider annotation?
Usage of @WebserviceProvider in handling SOAP based webservices