All services should be exposed through their own xyzClientLogic class, and created as a Spring Bean. An xyzClientLogic class should be a subclass of the BaseClientLogic class, so it inherits the standard client logic methods.
import com.sybase365.mobiliser.money.services.api.ITransactionEndpoint; private ITransactionEndpoint wsTransactionEndpoint; public void setWsTransactionEndpoint(ITransactionEndpoint wsTransactionEndpoint) { this.wsTransactionEndpoint = wsTransactionEndpoint; }
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())) request.setCustomerId(criteria.getCustomerId().longValue()); request.setFromDate(criteria.getFromDateXml()); request.setToDate(criteria.getToDateXml()); request.setMerchantOrderIdFilter(criteria.getOrderID()); request.setShowFaulty(criteria.getShowFaulty()); request.setStatusFilter(criteria.getTxnStatus()); request.setMaxRecords(maxNumberToFetch.intValue()); request.setJoinedCustomerId(criteria.getJoinedCustomerId()); request.setCustomerIsPayer(criteria.getConsumerIsPayer()); request.setShowInitial(criteria.getShowInitial()); request.setCaller(criteria.getCallerId()); FindTransactionsResponse response = wsTransactionEndpoint. findTransactions(request); if (!evaluateMobiliserResponse(response)) { LOG.warn("# An error occurred while loading customer transactions"); } return response.getTransactions(); } }
public <Req extends MobiliserRequestType> Req getNewMobiliserRequest(Class<Req> requestClass) throws Exception {}
public <Resp extends MobiliserResponseType> boolean evaluateMobiliserResponse(Resp response){ }
... public class AddFunds extends BaseManageAccountsPage { private static final long serialVersionUID = 1L; @SpringBean(name = "systemAuthTransactionClientLogic") public TransactionClientLogic transactionClientLogic; ...