Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is it possible to make a servlet to a webservice?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know a java program can be made as webservice. Is it possible to make a servlet to webservice. can a webapplication is converted to webservice?

in a website if we enter personal data and press submit button then it called dopost() or doget()method of HTTPservlet. can we make this servlet as webservice?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this question any different from this one?

Let me turn tables: Do you think a web app can be transformed into a web service? If yes, why? If not, why not? Trying to answer these (and posting the answers here), would be a good starting point to know where you might need some help.
 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In above I mentioned that there is a website which takes input parameters of user information and that servlet stores that information in database.

Here I would like to this manual process of entering data automatically by calling a webservice.

Here I have 2 options one is rewrite servlet as a stand alone java class and convert it into webservice
other optin is converting the existing servlet application into webservice.

Here how can I convert a sevlet into webservice? like in case of weblogic or websphere is there any tools to convert?

Yamini
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here I have 2 options one is rewrite servlet as a stand alone java class and convert it into webservice
other optin is converting the existing servlet application into webservice.


I don't see any real difference between the two. The web service is implemented in its own class, and ususally implements an interface, which is then used to create helper classes. Tools like java2wsdl and wsdl2java (which come with Axis) help in that process. There's really very little code you need to write by hand, except for the service implementation, and possibly some client-side code. I'm sure WL and WS come with comparable tools; they should be mentioned in the documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic