Implementing a Mortgage Loan Application with Fault

This sample shows a service implementation that invokes fault using a service and reference binding.

In this sample, the service implements a simplified online mortgage broker application. The borrower requests a loan through a broker and the broker processes the loan request using one of the third-party partner services. The borrower can specify the preferred third-party provider. The third-party partner services request credit rating of the borrower from a credit check service and in turn replies with fault message if requested loan amount is not valid.

Procedure

  1. In the samples directory, select binding > soap > http > MortgageLoanClientFault and double-click tibco_bw_sample_binding_soap_http_mortgagebrokerservice. For more information, see Accessing Samples.
  2. In Project Explorer, expand the tibco_bw_sample_binding_soap_http_mortgagebrokerservice project.
  3. Fully expand the Processes directory and double-click LoanRequestProcess.bwp.
  4. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  5. Double-click the requestLoanOperation activity.


  6. Click the Input tab and modify the values for the Name, Amount and Preferred bank fields. Enter amount less than or equal to 25000 or greater than equal to 100000 in the Amount field.


  7. Click Run > Debug Configurations.
  8. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  9. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco_bw_sample_binding_soap_http_mortgagebrokerservice_application.
  10. Click Debug.
    This executes the sample in Debug mode.
  11. Click the Terminate icon to stop the process.

Result

When a preferred bank is specified, the corresponding bank service is invoked.

Bank_A and Bank_C, when invoked, returns fault message Requested Loan Amount is not valid. Loan amount should be more than 25000 and less than 100000.

Understanding the Configuration

The following shared resources are defined in the project:
  • HTTPConnectorResource.httpConnResource: The HTTP Connection Shared Resource that contains the transport configuration.
  • BankLoanSchema.xsd: The XSD Schema file that contains the definition of the types used by the Bank web service's interface.
  • BrokerSchema.xsd: The XSD Schema file that contains the definition of the types used by the Broker web service's interface.
  • CreditCheckSchema.xsd: The XSD Schema file that contains the definition of the types used by the Credit Check web service's interface.
  • BankWSDLAbstract.wsdl: Common service interface to request for a loan from a bank.
  • CreditCheckWSDL.wsdl: The WSDL file that describes the Credit Check web service.
  • BrokerWSDL.wsdl: The WSDL file that describes the Mortgage Broker web service.
The example consists of the following:
  • CreditCheckService: Provides services for loan approvals. In this example, the borrowers can choose one of the two banks, Bank A and Bank C. These services call CreditCheckService to approve or reject a loan request or to verify if the requested loan amount is not valid.
  • Bank_A_Process / Bank_C_Process: Provides service to get the credit rating for a customer by calling a process that generates a credit score or reply with a fault message if the requested loan amount is invalid.
  • mortgageBroker.LoanRequestProcess: Provides service to request for a loan through the Mortgage Broker. The broker in turn checks with the preferred bank for the loan.
  • LoanRequestProcess: Allows the borrower to issue a loan request. The borrower can specify Name, Amount, and Preferred Bank. Depending on the Preferred Bank value the respective Bank Process is invoked.