Top Banner
1)Hello World Steps: 1.Copy the jax jars to the jdk and tomcat lib
6

Web Services Lab Manual

Oct 16, 2015

Download

Documents

Nuha Noor

hello world
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

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