Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ************************************************ REQUEST *****************************************************
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.axefinance.longbridgetech.com/">
- <soapenv:Header/>
- <soapenv:Body>
- <ws:CreateCollateral>
- <!--Optional:-->
- <transactionId>107725</transactionId>
- </ws:CreateCollateral>
- </soapenv:Body>
- </soapenv:Envelope>
- ************************************************ REQUEST END *****************************************************
- ************************************************ RESPONSE *****************************************************
- <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
- <S:Body>
- <ns2:CreateCollateralResponse xmlns:ns2="http://ws.axefinance.longbridgetech.com/">
- <return>
- <errorMessage>The account does not exist.</errorMessage>
- <mitigantID>4280</mitigantID>
- <transactionID>107725</transactionID>
- </return>
- <return>
- <errorMessage>Finacle System Error Occoured!!! Please contact System Administrator.</errorMessage>
- <mitigantID>4278</mitigantID>
- <transactionID>107725</transactionID>
- </return>
- </ns2:CreateCollateralResponse>
- </S:Body>
- </S:Envelope>
- ************************************************ RESPONSE END *****************************************************
- ************************************************ RESPONSE OBJ CLASS *************************************************
- public class CollateralResponse implements Serializable {
- private String ColtrlId ;
- private String MitigantID;
- private String TransactionID;
- private String ErrorMessage;
- public CollateralResponse(String coltrlId, String mitigantID, String transactionID, String errorMessage) {
- ColtrlId = coltrlId;
- MitigantID = mitigantID;
- TransactionID = transactionID;
- ErrorMessage = errorMessage;
- }
- public CollateralResponse() {
- }
- public String getColtrlId() {
- return ColtrlId;
- }
- public void setColtrlId(String coltrlId) {
- ColtrlId = coltrlId;
- }
- public String getMitigantID() {
- return MitigantID;
- }
- public void setMitigantID(String mitigantID) {
- MitigantID = mitigantID;
- }
- public String getTransactionID() {
- return TransactionID;
- }
- public void setTransactionID(String transactionID) {
- TransactionID = transactionID;
- }
- public String getErrorMessage() {
- return ErrorMessage;
- }
- public void setErrorMessage(String errorMessage) {
- ErrorMessage = errorMessage;
- }
- @Override
- public String toString() {
- return "CollateralResponse{" +
- "ColtrlId='" + ColtrlId + '\'' +
- ", MitigantID='" + MitigantID + '\'' +
- ", TransactionID='" + TransactionID + '\'' +
- ", ErrorMessage='" + ErrorMessage + '\'' +
- '}';
- }
- }
- ************************************************ RESPONSE OBJ CLASS END *********************************************
- ************************************************ SERVICE CLASS ***************************************************
- package com.longbridgetech.axefinance.ws;
- import com.longbridgetech.axefinance.FinnacleIntegrator.functions.*;
- import com.longbridgetech.axefinance.domain.*;
- import com.longbridgetech.axefinance.domain.responses.CollateralResponse;
- import com.longbridgetech.axefinance.interfaces.AxeDBManager;
- import com.longbridgetech.axefinance.persistence.AxeDBManagerImpl;
- import com.longbridgetech.axefinance.persistence.TaskDAOImpl;
- import com.longbridgetech.axefinance.tasks.CreateCIFTask;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import javax.jws.WebMethod;
- import javax.jws.WebParam;
- import javax.jws.WebService;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by wale on 6/29/15.
- */
- @WebService()
- public class AxeProcessorService {
- private final Logger logger = LoggerFactory.getLogger(AxeProcessorService.class);
- @WebMethod
- public List<CollateralResponse> CreateCollateral(@WebParam(name="transactionId")String transactionId){
- FIResponse fiResponse = new FIResponse();
- AxeDBManager axeDBManager = new AxeDBManagerImpl();
- List<CollateralDetail> collateralDetails = axeDBManager.getCollateralDetails(transactionId);
- List<CollateralResponse> collateralResponses = new ArrayList<CollateralResponse>();
- for(CollateralDetail collateralDetail : collateralDetails) {
- if (collateralDetail == null) {
- CollateralResponse collateralResponse = new CollateralResponse();
- collateralResponse.setErrorMessage("Collateral Detail for Transaction ID " + transactionId + " was not found");
- collateralResponse.setTransactionID(transactionId);
- logger.error("Collateral Detail for Transaction ID {} was not found", transactionId);
- collateralResponses.add(collateralResponse);
- continue;
- }
- String collateralType = collateralDetail.getCollateralType();
- if (StringUtils.isBlank(collateralType)) {
- CollateralResponse collateralResponse = new CollateralResponse();
- collateralResponse.setErrorMessage("Collateral Type was not specified in record with Mitigant ID " + collateralDetail.getMitigantID());
- collateralResponse.setTransactionID(transactionId);
- collateralResponse.setMitigantID(collateralDetail.getMitigantID());
- logger.error("Collateral Type was not specified in record with Mitigant ID " + collateralDetail.getMitigantID());
- collateralResponses.add(collateralResponse);
- continue;
- }
- if (collateralType.equals("COLDEPOC")) {
- DepColtrlAddData depColtrlAddData = new DepColtrlAddData(collateralDetail);
- DepColtrlAdd depColtrlAdd = new DepColtrlAdd(depColtrlAddData);
- fiResponse = depColtrlAdd.execute();
- } else if (collateralType.equals("COLMACH")) {
- MachineryCollateralAddData machineryCollateralAddData = new MachineryCollateralAddData(collateralDetail);
- MachineryColtrlAdd machineryColtrlAdd = new MachineryColtrlAdd(machineryCollateralAddData);
- fiResponse = machineryColtrlAdd.execute();
- } else if (collateralType.equals("COLOTHRS")) {
- OthersColtrlAddData othersColtrlAddData = new OthersColtrlAddData(collateralDetail);
- OthersColtrlAdd othersColtrlAdd = new OthersColtrlAdd(othersColtrlAddData);
- fiResponse = othersColtrlAdd.execute();
- } else if (collateralType.equals("COLPROPC")) {
- ImmovPropColtrlAddData immovPropColtrlAddData = new ImmovPropColtrlAddData(collateralDetail);
- ImmovPropColtrlAdd immovPropColtrlAdd = new ImmovPropColtrlAdd(immovPropColtrlAddData);
- fiResponse = immovPropColtrlAdd.execute();
- } else if (collateralType.equals("COLSHARC")) {
- TradableSecuritiesColtrlAddData tradableSecuritiesColtrlAddData = new TradableSecuritiesColtrlAddData(collateralDetail);
- TradableSecuritiesColtrlAdd tradableSecuritiesColtrlAdd = new TradableSecuritiesColtrlAdd(tradableSecuritiesColtrlAddData);
- fiResponse = tradableSecuritiesColtrlAdd.execute();
- } else if (collateralType.equals("COLVEHIC")) {
- VehiclesColtrlAddData vehiclesColtrlAddData = new VehiclesColtrlAddData(collateralDetail);
- VehiclesColtrlAdd vehiclesColtrlAdd = new VehiclesColtrlAdd(vehiclesColtrlAddData);
- fiResponse = vehiclesColtrlAdd.execute();
- }
- CollateralResponse collateralResponse = new CollateralResponse();
- collateralResponse.setTransactionID(transactionId);
- collateralResponse.setMitigantID(collateralDetail.getMitigantID());
- if(fiResponse.isSuccessful()){
- collateralResponse.setColtrlId(fiResponse.getResponse());
- }else{
- collateralResponse.setErrorMessage(fiResponse.getResponse());
- }
- collateralResponses.add(collateralResponse);
- }
- logger.info("CreateCollateral complete {}",collateralResponses);
- return collateralResponses;
- }
- }
- ************************************************ SERVICE CLASS END *************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement