Developer

Services Interface – Spring Configuration

The Web UI provides service client interfaces through Spring configuration.

  • Context beans identify service access points and the implemented service interfaces.
  • Client logic beans provide the caller logic for accessing various end-point interface services.

Below is an example of a refreshable SOAP client Spring bean for the transaction service client context and logic beans..

application-common-context.xml:

  
 ...       
<!-- MOBILISER SERVICE CONFIGURATION - GENERAL -->       

<bean id = "soapClientFactory"     
 class = "com.sybase365.mobiliser.util.tools.clientutils.soap.SoapClientFactory" />
<bean id="serviceConfigurationBase"      
 class="com.sybase365.mobiliser.util.tools.wicketutils.services.Configuration">     
 <property name="preferences" ref="prefsNode" />   
</bean>   

<bean id="serviceConfiguration" parent="serviceConfigurationBase" />       
...

system-clients-context.xml:

<bean id="clientTargetSourceParent" abstract="true"    
class="com.sybase365.mobiliser.util.tools.clientutils.api.RefreshableClientTargetSource">     
<property name="clientFactory" ref="soapClientFactory" />   
</bean>       
...       
<!-- TRANSACTION CONTEXT CLIENT -->   
<bean id="systemAuthTransactionClientSource" parent="clientTargetSourceParent">     
  <property name="clientInterfaces" ref="transactionInterfaces" />     
  <property name="endpointSuffix" value="/transaction" />     
  <property name="configuration">       
<bean parent="serviceConfigurationBase">         
  <property name="qualifier" value=".transaction" />       
</bean>     
</property>   
</bean>     
<bean class="com.sybase365.mobiliser.util.prefs.util.RegisterChangeListenerFactoryBean">     
  <constructor-arg ref="prefsNode" />     
  <constructor-arg ref="systemAuthTransactionClientSource" />   
</bean>     
<bean id="systemAuthTransactionContextClient" 
class="org.springframework.aop.framework.ProxyFactoryBean">     
  <property name="targetSource" ref="systemAuthTransactionClientSource" />     
  <property name="interfaces" ref="transactionInterfaces" />   
</bean>     
<bean id="systemAuthTransactionClientLogic"    
class="com.sybase365.mobiliser.web.application.clients.TransactionClientLogic">     
  <property name="wsAuthEndpoint" ref="systemAuthTransactionContextClient" />     
  <property name="wsPreAuthEndpoint" ref="systemAuthTransactionContextClient" />   
...  
For service clients that match multiple service endpoints, you can use Spring aliases to differentiate between interfaces. For example:
<alias name="systemAuthTransactionContextClient" alias="systemAuthTransactionCancelClient" />   
<alias name="systemAuthTransactionContextClient" alias="systemAuthConfirmVoucherClient" />   
<alias name="systemAuthTransactionContextClient" alias="systemAuthStartVoucherClient" /> ...