Convert servlet to a webservice
I have a servlet to a webservice in java,
I have a ser开发者_开发知识库vlet that process user information ,(registeration) and return a result as a string , how do I use that servlet as webservice to be called and do the same thing?
Look at JAX-WS that is a Java specification for webservices, making a POJO service available as a Webservice Soap Endpoint. http://jax-ws.java.net/
You may need to move your code from your servlet to a POJO class.
There are several methods depending on your need. I found the WebService Axix User guide quite useful here -> http://ws.apache.org/axis/java/user-guide.html
It contains description on how to use the Java2WSDL tool which ultimately allows you to publish your final webservice. http://ws.apache.org/axis/java/user-guide.html#Java2WSDLBuildingWSDLFromJava
精彩评论