写java接口_java写接口

1.先导spring包

bc5e1d87500b6928cfbb0e59fea229e7.png

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   (把上面代码复制就可以运行)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值