Here the solution :
I developped a BeanFactoryPostProcessor. Let's call it a "RegistryPlaceHolderConfigurer".
I inject a bean to retrieve availables services in Registry. I called it "RegistryMetaDataProvider".
Imagine I have published a service in my registry. "dummyService"
It's URI in registry could be : //FOOCOMPANY/FOODEPARTMENT/FOOAPPLICATION/DUMMY
Note : thanks to registry we can easily configure both security and versioning.
I use to externalize environment constants using a properties file. Let's call it
dev-configuration.properties :
Code:
# Sample registry configuration
conf.registry.username=...
conf.registry.password=...
conf.registry.host=...
conf.registry.port=...
# Sample service declaration
soa.service.dummyURI=//FOOCOMPANY/FOODEPARTMENT/FOOAPPLICATION/DUMMY
Beginning of the Spring Definition File :
Code:
<bean id="myPropertyPlaceHolder" class="org.springframework.beans.factory.config.PropertyPlaceHolderConfigurer">
<property name="order" value="1">
<property name="locations">
<value>dev-configuration.properties</value>
</property>
</bean>
<bean id="myRegistryPlaceHolder" class="package.MyRegistryPlaceHolderConfigurer">
<property name="order" value="2" />
<property name="registryMetaDataProvider" ref="myRegistryMetaDataProvider" />
</bean>
<bean id="myRegistryMetaDataProvider" class="package.MyRegistryMetaDataProvider">
<property name="host">
<value>${conf.registry.host}</value>
</property>
<property name="username">
<value>${conf.registry.username}</value>
</property>
<property name="password">
<value>${conf.registry.password}</value>
</property>
<property name="port">
<value>${conf.registry.port}</value>
</property>
And finally the definition of a service using XFIRE when the WSDL url is published in a Registry :
Code:
<bean id="myDummyService" class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
<property name="serviceClass">
<value>package.service.DummyService</value>
</property>
<property name="wsdlDocumentUrl">
<value>@registry{${soa.service.dummyURI}}</value>
</property>
[... outhandlers...serviceFactory....]
</bean>
It works perfectly.
Hope this help someone, one day.