JAVA SERVICE好简洁【转】
package lavasoft;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
/**
* Java6开发WebService入门
*
* @author lavasoft 2009-11-13 16:10:44
*/
@WebService
public class ServiceServer {
/**
* Web服务中的业务方法
*
* @return 一个字符串
*/
public String doSomething(){
return " Hello Java6 WebService!";
}
public static void main(String[] args) {
//发布一个WebService
Endpoint.publish("http://192.168.1.78:8080/lavasoft.ServiceServer", new ServiceServer());
}
}