@toc
编写服务
package;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class TestWebService {
@WebMethod
public String sayHi() {
return "hi";
}
public static void main(String[] args) {
Endpoint.publish("http://localhost:8088/ws/test", new TestWebService());
}
}
访问服务
打开浏览器访问:http://localhost:8088/ws/test?wsdl