• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help in understanding javax.xml.ws.Provider<T>

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 javax.xml.ws.Provider<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 javax.xml.ws.Provider<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.

Thanks
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Hany.
 
reply
    Bookmark Topic Watch Topic
  • New Topic