接着那个短信网关的项目,由于项目采用了spring。axis2和spring结合比较简单,但是axis和spring的结合可能要绕点路子哦。

首先GenUserImpl是我们要发布axis webservice的类。首先让它继承ServletEndpointSupport

 
  
  1. public class GenUserImpl  extends ServletEndpointSupport implements GenUserInter { 

再实现方法

 

 
  
  1. @Override 
  2.     public SMSResultAggre queryReturnReceiptAggre(CII cii, EchoQuery echoQuery) { 
  3.         return this.server.queryReturnReceiptAggre(cii, echoQuery); 
  4.     } 
  5.  
  6.      protected void onInit() throws ServiceException 
  7.      { 
  8.             // 在 Spring 容器中获取 Bean 的实例 
  9.          this.server= (GenUserInter) getApplicationContext() 
  10.                           .getBean("gui"); 
  11.      } 

如此即可~~    by dp