接着那个短信网关的项目,由于项目采用了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
转载于:https://blog.51cto.com/dp0304/692193