1.先导spring包
2.首先配置spring.xml的监听web.xml配置。
contextConfigLocation
classpath:Spring-Context.xml
org.springframework.web.context.ContextLoaderListener
3.配置spring.xml文件
//扫描的包(就是类的包名)
//要暴露的接口
4.就是实体类了
@Component
@WebService(serviceName="lmtService",targetNamespace="lmtCore")
public class LmtList {
@WebMethod
public String getLmtList(@WebParam(name="lmt",targetNamespace="lmtList")String lmtXml) {
System.out.println(lmtXml);
return "YES";
}
}
5.访问接口时要加上实体类的serviceName 例如以上访问地址:http://192.168.10.183:8800/services/lmtService (把上面代码复制就可以运行)