• Post Reply Bookmark Topic Watch Topic
  • New Topic

Web Service Declared as Servlet ?  RSS feed

 
Paul Lusk
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Moose-Wranglers,
I am new to Web services so it just seems strange that a Web Service interface needs to be declared as a Servlet in a web.xml file. The fact that the Interface does not even import the servlet classes and does not contain the line about extending HTTPServlet is even more surprising. The Web Service in question does indeed deploy and work as designed, but i would appreciate any insights into this situation. Thanks in advance
PL
 
Ram Para
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please tell what you are trying to do ?

You seems to be confused .
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Strictly speaking, you do not need to configure the web.xml at all if you do Java-first web service development with JAX-WS.
I guess the configuring a web service endpoint in the web.xml is a relic from days passed in the life of Java web services. If your web service endpoint is not an EJB, then it is called servlet-based endpoint. The container in which the web service is run will wrap your class, the one that do not extend HTTPServlet, using a generated servlet. I suspect this is container-specific behaviour, so I cannot promise that this is always the case, but this is what I have experienced.
Hope this sheds some light on your questions.
Best wishes!
 
Paul Lusk
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer Ivan. That makes sense because this is a POJO-based Web Service example from a book I am studying to teach myself this technology. I am sure the book will have further examples that are EJB-based. I am just trying to get the full value from my reading by understanding how things work and not just accepting that they do work. Thanks again.
PL
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!