Exposing a Spring POJO as a Web Service using XFire
Submitted by rowell on Tue, 01/15/2008 - 09:49
In your web.xml, add the following configuration:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:org/codehaus/xfire/spring/xfire.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:org/codehaus/xfire/spring/xfire.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Then, add the following to your Spring context file..
<bean class="org.codehaus.xfire.spring.remoting.XFireExporter">
<property name="serviceFactory" ref="xfire.serviceFactory" />
<property name="xfire" ref="xfire" />
<property name="serviceBean" ref="serviceImpl" />
<property name="serviceClass" value="com.samples.interface.Service" />
</bean>
<property name="serviceFactory" ref="xfire.serviceFactory" />
<property name="xfire" ref="xfire" />
<property name="serviceBean" ref="serviceImpl" />
<property name="serviceClass" value="com.samples.interface.Service" />
</bean>