| Author |
Difference between @WebService and @WebServiceProvider annotation?
|
Mahabub Ali Mohammad
Greenhorn
Joined: Oct 30, 2008
Posts: 3
|
|
Hi All,
Can anyone explain me the difference between annotating a java service with @WebService and @WebServiceProvider?
Thanks in Advance
-Mahabub Ali Mohammad.
|
 |
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2194
|
|
Hi!
The annotation WebServiceProvider is used in endpoint classes implementing the javax.xml.ws.Provider<T> to associate the class with a <wsdl:service> element and a <wsdl:port> element in specified WSDL document. Such an endpoint works directly with (SOAP) messages or (SOAP) message payloads.
Note that the Provider<T> interface only has one single method, which in an implementing class will provide all the different messages received by the endpoint, while a class annotated with the WebService has one method for each kind of message the endpoint class can receive.
A class can either be annotated with the WebService or the WebServiceProvider annotation, but not both.
|
My free books and tutorials: http://www.slideshare.net/krizsan
|
 |
Mahabub Ali Mohammad
Greenhorn
Joined: Oct 30, 2008
Posts: 3
|
|
Thanks Navi
Regards,
Mahabub Ali Mohammad.
|
 |
anas alsarairah
Greenhorn
Joined: Sep 27, 2007
Posts: 27
|
|
hello
do you mean that the application server wont generate a WSDL file for web services annonated using @WebServiceProvider ?
thanks
|
 |
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2194
|
|
Hi!
anas alsarairah wrote:
do you mean that the application server wont generate a WSDL file for web services annonated using @WebServiceProvider ?
Correct - there is no way the application server knows what operations etc are supported by a web service annotated with @WebServiceProvider.
You may, however, supply an existing WSDL.
Best wishes!
|
 |
 |
|
|
subject: Difference between @WebService and @WebServiceProvider annotation?
|
|
|