微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

XFire与SSH集成

1.XFIRE中有spring的1.2.6的jar包会与你集成的spring2中的jar包冲突,所以要删除xfire中的spring1.2.6的jar包解决冲突报错的问题。

2.与spring集成之后WEBSERVICE将由spring去处理所以配置webservice之前要在web.xml中配如下信息

 <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:org/codehaus/xfire/spring/xfire.xml,classpath:applicationContext-webService.xml</param-value>
    </context-param>

    <listener>
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

既然要交给spring去处理了所以web.xml中配置的xfire所用到的包也要替换成spring中的包,如下配置:

<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.在spring中配置WebService

<bean id="wsimpl" class="com.tcwebservice.test.Wsimpl"></bean> <bean name="sh" class="org.codehaus.xfire.spring.ServiceBean"> //访问webservice的名称  <property name="serviceBean" ref="wsimpl"></property> //发布的WEBSERVICE的实现类  <property name="serviceClass" value="com.tcwebservice.test.Wstest"></property> //对应实现类的接口 </bean>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐