PS:后面有github地址,如有不懂或者想复制配置文件和代码,可看demo
我的JDK是1.8,开发环境是windows7,使用的IDEA版本是
按下图先新建项目
此步骤下来生成的web/WEB-INF/web.xml是不完整的,此处有坑,请大家修改如下:
在HelloWorld.java编写代码如下:
import javax.jws.WebService;
@WebService
public class HelloWorld {
public StringsayTitle(String from){
String result ="title is" + from;
System.out.println(result);
return result;
}
public StringsayBody(String other){
String result ="-------------body----------" + other;
System.out.println(result);
return result;
}
public StringsayAll(String title,String body){
String