1、编写xfire 配置文件xfire.xml(用于声明webservice服务)
?<?xml version="1.0" encoding="UTF-8"?>
?<beans xmlns="http://www.springframework.org/schema/beans"
??????? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
??????? xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
???? <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
???? <bean id="taskWS" class="com.xxx.task.ws.xfire.TaskServiceImpl"></bean>
???? <bean name="TaskService" class="org.codehaus.xfire.spring.remoting.XFireExporter">
???????? <property name="serviceClass" value="com.xxx.task.ws.xfire.TaskService" />
???????? <property name="serviceBean" ref="taskWS" />
???????? <property name="xfire" ref="xfire" />
???? </bean>
?</beans>??
2、在web.xml中配置xfire Servlet? 并加载我们刚刚写好的xfire.xml 文件
?<context-param>
??<param-name>contextConfigLocation</param-name>
??<param-value>classpath:spring.xml,classpath:xfire.xml</param-value>
?</context-param>?
???<servlet>
??<servlet-name>XFireServlet</servlet-name>
??<!--?不与spring整合使用的servlet
??<servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
?? -->
??<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
?</servlet>
<servlet-mapping>
??<servlet-name>XFireServlet</servlet-name>
??<url-pattern>/services/*</url-pattern>
?</servlet-mapping>