1首先创建maven项目,编写一个类,里面写上接口代码
@WebService //加上服务注解
public class HelloWorld {
@WebMethod //加上方法注解
public String sayHelloWorldFrom(String from) {
String result = "Hello, world, from " + from;
ServerTest test=new ServerTest();//模拟服务端的业务层处理传参,只要把参数传给server方法,就可以随意CRUD进来的参数值了
test.method(from);
return from;
}
@WebMethod //加上方法注解
public String sayHelloWorldFrom1(String from) {
String result = "就是:"+from;
System.out.println(result);
return result;
}
public static void main(String[] args) {
Endpoint.publish("http://192.168.93.8:8080/Service/ServiceHello", new He