Introduction
ServiceMix provides support for the XFire SOAP stack, allowing clean integration between XFire and ServiceMix. XFire is an easy-to-use SOAP framework that offers high performance.
Before reviewing the partial example below, it is strongly recommended that you read the Spring XFire instructions
.
Steps to Integrate with XFire
The first step is to create a service bean, for example:
package org.servicemix.components.xfire;
public class Echo {
public String echo(String msg) {
return msg;
}
}
Next, define this service bean in your bean definitions:
<bean id="echo" class="org.servicemix.components.xfire.Echo" singleton="true"/>
<bean name="Echo" class="org.codehaus.xfire.spring.ServiceBean">
<property name="service" ref="echo"/>
<property name="serviceFactory" ref="xfire.serviceFactory"/>
<property name="xfire" ref="xfire"/>
</bean>
Then, to expose your service on the JBI bus, register a JBI binding for the service:
<sm:activationSpec componentName="binding" service="xfire:Echo">
<sm:component><bean class="org.apache.servicemix.components.xfire.XFireBinding">
<property name="xfire" ref="xfire"/>
</bean></sm:component>
</sm:activationSpec>
Location of the ServiceMix XFire Components
- The source code for the ServiceMix 3.x XFire components can be found at:
[servicemix_src_install_dir]\servicemix-components\src\main\java\org\apache\servicemix\components\xfire
where [servicemix_src_install_dir] is the directory in which ServiceMix is installed.
- The source code for the ServiceMix 2.0.x XFire components can be found at:
[servicemix_src_install_dir]\components\base\src\main\java\org\servicemix\components\xfire
where [servicemix_src_install_dir] is the directory in which ServiceMix is installed.
Additional Resources
For details on XFire, please refer to XFire SOAP stack
.