接着那个短信网关的项目,由于项目采用了spring。axis2和spring结合比较简单,但是axis和spring的结合可能要绕点路子哦。首先GenUserImpl是我们要发布axis
webservice的类。首先让它继承ServletEndpointSupport
public class GenUserImpl extends ServletEndpointSupport implements GenUserInter {
再实现方法
@Override
public SMSResultAggre queryReturnReceiptAggre(CII cii, EchoQuery echoQuery) {
return this.server.queryReturnReceiptAggre(cii, echoQuery);
}
protected void onInit() throws ServiceException
{
// 在 Spring 容器中获取 Bean 的实例
this.server= (GenUserInter) getApplicationContext()
.getBean("gui");
} 如此即可~~ by dp
本文详细介绍了如何将Spring框架与Axis2结合用于发布Webservice,并通过实例展示了具体实现过程,包括创建服务接口、配置及初始化工作。
3224

被折叠的 条评论
为什么被折叠?



