Meaningless Drivel is fun!
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Help in understanding<T> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Help in understanding<T>" Watch "Help in understanding<T>" New topic

Help in understanding<T>

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 547

Hi All,

This question is related to the topic "String Processor Web Service Example (Provider)" page 155 from Ivan's notes.

I did not understand the objective of this topic and its relationship to<T>. It would be great if somebody, could show me some guidance.

A web service can also be written to process entire protocol messages, usually SOAP, or message
payloads, which in the case with SOAP is the contents of the SOAP body element.
Such a web service class will implement the<T> interface and be annotated
with the @WebServiceProvider annotation.

What does it mean by processing the entire protocol message/payload. This is what every webservice does. Why should this implement Provider interface? How is this different from earlier example given in Ivans which does not implement any interface but the required server side artifacts are generated using wsgen.

Bottomline, what is the purpose of this interface and how is this different from normal webservice where it need not imlement Provider.



Hany Shafik
Ranch Hand

Joined: Jun 21, 2008
Posts: 80
Hi Kumar,

There is two ways to provide a web service in jax-ws. One of them is to provide normal java interface and the interface is mapped to a wsdl through jax-ws annotation. This has the advantage of being at a high level meaning you don't have to worry yourself about the grim details about soap message and parsing the xml content and mapping it your java objects, as this part is handled by the jax-ws provider. Also you don't concern yourself with generating the xml response conformant to your wsdl.
The second method is to implement Provider interface, if you have your service implement such method you will have to work on these low level issues related to parsing and mapping/serializing and dispatching code for each soap request also handling the response by creating the appropriate xml response.
You can choose whatever method appropriate depending on your case as each method has it's own advantages and disadvantages.
Hope this helps
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 547

Thank you Hany.
I agree. Here's the link:
subject: Help in understanding<T>
It's not a secret anymore!