
package com.example.loan_approval.wsdl;

import java.math.BigInteger;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;


@WebService(targetNamespace = "http://example.com/loan-approval/wsdl/",
endpointInterface="com.example.loan_approval.wsdl.LoanApprovalPT", serviceName="loanApprover", portName="loanApprover_Port")
public class LoanApprovalPTImpl implements LoanApprovalPT {
    
	public String approve(String firstName, String name,
        		BigInteger amount) throws ErrorMessage { 
		System.out.println("\nLoanApprovalPTImpl");
		System.out.println("*************************************************");
		System.out.println("firstName Parameter: " + firstName );
		System.out.println("name Parameter: " + name );
		System.out.println("amount Parameter: " + amount );
		System.out.println("*************************************************");
		System.out.println("\n");

		if (amount.intValue() >= 20000) {
			throw new ErrorMessage("Amount too large", amount);
		}

		return "Evaluated and Approved";
	}

}
