Usage
Pull in library via maven/gradle from Artifactory
<dependency> <groupId>edu.hawaii.its.kfs</groupId> <artifactId>kfs-webservice-client</artifactId> <version>1.5</version> </dependency>
Spring Context config (only reference to wsdl needs to change per environment, all other values remain unchanged)
<bean id="uhAccountWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean"> <property name="wsdlDocumentUrl" value="${kfs.account.wsdl}"/> <property name="namespaceUri" value="KFS"/> <property name="lookupServiceOnStartup" value="false"/> <property name="serviceName" value="UhAccountWebService"/> <property name="portName" value="UhAccountWebServicePort"/> <property name="serviceInterface" value="edu.hawaii.its.kfs.coa.UhAccountWebService"/> </bean>
WSDL for KFS environments
kfs.account.wsdl=@kfs.base.url@/remoting/UhAccountWebService?wsdl kfs.base.url=https://test6.kfs.hawaii.edu/kfs-tst6
KFS Environments
- https://test6.kfs.hawaii.edu/kfs-tst6
- https://qa6.kfs.hawaii.edu/kfs-qa6
- https://kfs.hawaii.edu/kfs-prd6
Java method to call one of the endpoints
public static AccountItem validateAccountInKFS(AccountItem item) { String returnFlag = ""; UhAccountWebService service = SpringFacade.getUhAccountService(); String displayInfo = null; if (item.getAcctAccount() != null && !item.getAcctAccount().equalsIgnoreCase("")) { try { AccountWebType a = service.getAccountByPrimaryId(item.getAcctCampus(), item.getAcctAccount()); if (a != null) { item.setAcctTitle(a.getAccountName().getValue()); item.setAcctFoCode(a.getUhFoCode().getValue()); item.setAcctRespPerson(a.getAccountsSupervisoryFullName().getValue()); item.setAcctSupervisorUhuuid(a.getAccountsSupervisorySystemsIdentifier().getValue()); item.setAcctFoUhuuid(a.getAccountFiscalOfficerSystemIdentifier().getValue()); displayInfo = translateForTesting(a); _log.debug(displayInfo); } else { item.setAcctTitle(StringUtils.EMPTY); item.setAcctFoCode(StringUtils.EMPTY); item.setAcctRespPerson(StringUtils.EMPTY); item.setAcctSupervisorUhuuid(StringUtils.EMPTY); item.setAcctFoUhuuid(StringUtils.EMPTY); } returnFlag = checkAccountStatus(a); if (StringUtils.isBlank(returnFlag) && StringUtils.isNotBlank(item.getAcctSubAccount())) { UhSubAccountWebType s = service.getSubAccountByPrimaryId(item.getAcctCampus(), item.getAcctAccount(), item.getAcctSubAccount().toUpperCase()); if (s != null) { displayInfo = translateForTesting(s); _log.debug(displayInfo); } returnFlag = checkSubAccountStatus(s); } } catch (Exception e) { _log.debug(GeneralUtil.getCustomStackTrace(e)); returnFlag = "1"; _log.debug("Account Info Not Found In KFS " + item.getAcctCampus() + item.getAcctAccount() + item.getAcctSubAccount()); } } item.setAcctFlag(returnFlag); _log.debug("KFS Account Validation: " + item.getAcctCampus() + " / " + item.getAcctAccount() + " / " + item.getAcctSubAccount() + ": " + item.getAcctFlag()); return item; }