web services lab manual
DESCRIPTION
hello worldTRANSCRIPT
1)Hello WorldSteps:1.Copy the jax jars to the jdk and tomcat lib
2)create the folder structure in the drive where jdk is configured.
WebServiceInterface.javapackage com.enterprise.ws;
import javax.jws.WebMethod;import javax.jws.WebService;import javax.jws.soap.SOAPBinding;import javax.jws.soap.SOAPBinding.Style;
@WebService@SOAPBinding(style = Style.RPC)public interface WebServiceInterface {
@WebMethodString printMessage();
}WebServiceImpl.javapackage com.enterprise.ws;
import javax.jws.WebService;
@WebService(endpointInterface = "com.enterprise.ws.WebServiceInterface")public class WebServiceImpl implements WebServiceInterface{
@Overridepublic String printMessage() {return "Hello";}
}4)Compile code
5)In Tomcat create the following structure
5)Place the compiled classes in ws folder6)Below web.xml and sun-jaxws.xml in WEB_INFweb.xml
com.sun.xml.ws.transport.http.servlet.WSServletContextListenersayhellocom.sun.xml.ws.transport.http.servlet.WSServlet1sayhello/sayhello30
Sun-jaxws.xml
7)in META_INF place the following fileMANIFEST.MFManifest-Version: 1.0Class-Path: 8)create a war
9) start tomcat
http://localhost:8080/JAX-WS-Tomcat/sayhello