现在的位置: 首页 > 综合 > 正文

Spring+xfire配置 xfire文件放置于WEB-INF中

2013年08月18日 ⁄ 综合 ⁄ 共 2835字 ⁄ 字号 评论关闭

1.xfire文件配置

 

2.web.xml

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
   /WEB-INF/spring/applicationContext-import.xml,/WEB-INF/xfire-servlet.xml
  </param-value>
 </context-param>

<servlet>
  <servlet-name>XFireServlet</servlet-name>
  <servlet-class>
   org.codehaus.xfire.spring.XFireSpringServlet
  </servlet-class>
  <load-on-startup>0</load-on-startup>
 </servlet>

<servlet-mapping>
  <servlet-name>XFireServlet</servlet-name>
  <url-pattern>/services/*</url-pattern>
 </servlet-mapping>

3.接口包中添加IWebServiceForApplication.aegis.xml 与接口名对应的.aegis.xml文件

IWebServiceForApplication.aegis.xml 文件内容用于有好显示接口参数名称

 <mappings>
    <mapping>
       <method name="getDeviceList">  
           <parameter index="0" mappedName="username"/>
           <parameter index="1" mappedName="password" />
           <parameter index="2" mappedName="productSpec" />
           <parameter index="3" mappedName="level" />
       </method>

   </mapping>

</mappings>

4.远程接口实现类中可以使用Spring ioc注入bean对象

5.文件结构

 

抱歉!评论已关闭.