动态配置远程访问服务HttpInvoker

1.applicationContext.xml

<bean id="applicationContext"
class="com.kuoni.hop.util.ApplicationContextHolder" lazy-init="false" autowire="default" dependency-check="default" />

<!-- Confiuration of the PropertyPlaceholderConfigurer -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:hop-config.properties</value>
</property>
</bean>

<!-- SKY services -->
<bean id="skyMasterDataService"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceInterface"
value="com.kuoni.sky2.admin.server.service.hopConnection.RemoteMasterDataService" />
<property name="serviceUrl"
value="${sky.protocol}://${sky.serverNameAndPort}/${sky.contextPath}/remoteMDService" />
<property name="httpInvokerRequestExecutor">
<ref bean="httpInvokerExecutor" />
</property>

</bean>

2.hop-config.properties
sky.protocol=http
sky.serverNameAndPort=kobdt01.ch.kuoni.int:9082
# test.kuoni-dmc.com:80
sky.contextPath=skytest/remoting

你可能感兴趣的:(xml)