Services Interface – Client Logic Implementation

All services should be exposed through their own <xyz>ClientLogic class, and created as a Spring Bean. An <xyz>ClientLogic class should be a subclass of the BaseClientLogic class, so it inherits the standard client logic methods.

To implement an <xyz>ClientLogic class, import the required service interface and bean (or alias):
private ITransactionEndpoint wsTransactionEndpoint;       

public void setWsTransactionEndpoint(ITransactionEndpoint wsTransactionEndpoint) {    
  this.wsTransactionEndpoint =
Next, provide an access method that uses the new member field:
public   List <SimpleTransaction> findTransactions (    
  SearchTransactionCriteria criteria, Integer maxNumberToFetch )  
  throws Exception {    
  LOG.debug ("#  TransactionClientLogic.findTransactions ()");    
  List <SimpleTransaction> transactions = new ArrayList < SimpleTransaction >() ;    
  if (PortalUtils.exists(criteria.getCustomerId()))            

  FindTransactionsResponse response = wsTransactionEndpoint. findTransactions(request);              

  if (!evaluateMobiliserResponse(response))
    LOG.warn("# An error occurred while loading customer transactions");        
  return response.getTransactions();
Using the getNewMobiliserRequest helper method ensures that all requests are formed with correct values for these properties:
  • Origin – identifies the request as originating from the Web UI.
  • Conversation Id – a random value.
  • Trace No – a random value.
  • Audit Data – contains the browser user agent (or first 80 characters) of the Web request and the remote IP address of the sender.
public <Req extends MobiliserRequestType> 
   Req getNewMobiliserRequest(Class<Req> requestClass) 
   throws Exception {}
Using the evaluateNewMobiliserResponse helper method ensures that all responses are verified:
  • Valid Response – a status response code value of 0 indicates that processing can continue.
  • Session Ended Response – response codes 352 and 353 indicate that the session has been closed or expired; you are automatically redirected to the login page.
  • Another Error Response – other response codes require the method to look up the localized error message associated with the code.
public <Resp extends MobiliserResponseType> 
   boolean evaluateMobiliserResponse(Resp response){ }
Using a Spring Bean for the <xyz>ClientLogic class, defined in the section above, you can inject the client logic handler into a page to use, for example:
public class AddFunds extends BaseManageAccountsPage {       
  private static final long serialVersionUID = 1L;       
  @SpringBean(name = "systemAuthTransactionClientLogic")     
  public TransactionClientLogic transactionClientLogic;