在浏览器地址栏输入:http://192.168.149.1:9999/hello?wsdl 拿到WebService的使用说明书:
然后在浏览器地址栏输入:http://192.168.149.1:9999/hello?xsd=1 我们就可以查看方法接受的参数类型和返回值类型:
附上服务端的代码:
package cn.itcast.ws;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class HelloService {
public String sayHi(String name, int age) {
return "hi " + name;
}
public static void main(String[] args) {
Endpoint.publish("http://192.168.149.1:6666/hello", new HelloService());
System.out.println("server started");
}
}