xfire结合spring做客户端

2011-04-21  蔡秋亮 

spring客户端applicationContext.xml如下所示
<bean id="remoteServiceClass"
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
<property name="serviceClass">
<value>ServiceClass</value>
</property>
<property name="url">
<value>http://xxxx/ServiceClass</value>
</property>
<property name="serviceFactory">
<ref bean="xfire.serviceFactory" />
</property>
<property name="lookupServiceOnStartup">
<value>false</value>
</property>
<property name="properties">
<props>
<prop key="http.timeout">15000</prop>
</props>
</property>
</bean>
客户端代码如下所示:
    AbstractApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    ServiceClass serviceClass = (ServiceClass) ac.getBean("remotePaymentPartyFeeFacade");
Response response = serviceClass.getXXX(request);

非常方便
534°/5348 人阅读/0 条评论 发表评论

登录 后发表评论