Implementing a Service with a Service Binding and a Client with a Reference Binding
In this sample, a service implements a simplified online mortgage broker application. The borrower requests a loan through a broker. The broker processes the loan request using one of the third-party partner services. The borrower can either specify the preferred third-party provider or allow the broker to default to one. The third-party partner services request credit rating of the borrower from a credit check service and in turn approves or rejects the loan application based on the credit rating.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.binding.soap.http.MortgageBrokerServiceClient. For more information, see Accessing Samples.
- In Project Explorer, expand the tibco.bw.sample.binding.soap.http.MortgageBrokerServiceClient project.
- You can modify the values specified for the Name, Amount, and Preferred bank fields by clicking on the
Input tab of the
Invoke activity Client in the
borrower.LoanRequestProcess process.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.sample.binding.soap.http.MortgageBrokerServiceClient.application.
- Click
Debug.
This runs the sample in Debug mode.
- Click the
Terminate
icon to stop the process.
The response is printed to the console. The response contents are either response from Mortgage Broker:Name: John: Status: REJECTED, or response from Mortgage Broker:Name: John : Status: APPROVED.
- When a preferred bank is specified, the corresponding bank service is invoked. If not, Bank_A service is invoked.
- When the Bank_A and Bank_C services are invoked, either an Approved or Rejected message is returned, depending on the (random) credit score for the applicant.
Understanding the Configuration
This sample illustrates various features of the Process Reference. These features are present as options of Reference Type available on the General tab of the properties view of the Process Reference.
The available options are:
- Binding Reference
- Binding Reference - External
- Process Reference
- Process Reference - Dynamic
The following processes defined in this sample explain their features in the processes.
borrower.LoanRequestProcessThis process acts as a Consumer and allows the borrower to issue a loan request to the Mortgage Broker Service. The borrower specifies the values of the following fields in the requestLoanOperation activity in the borrower.LoanRequestProcess process.
- Borrower name
- Loan amount requested
- Preferred bank. Specify one of the available banks "Bank_A" and "Bank_C". By default, the broker service calls bank A, if no preferred bank is specified.
Note: Add an empty string "", for not specifying a preferred bank.
This process uses Process Reference option to invoke the Mortgage broker process. This options statically map the two Processes together.
This process receives the request from the borrower and calls the available SOAP Service Providers through subprocess calls.
Depending on the value of "Preferred bank" request field, this process either uses Process Reference -Dynamic option with Set EPR activity to dynamically call Bank_A_PartnerProcess or Bank_C_PartnerProcess sub process OR uses the Process Reference option to statically invoke the Default_PartnerProcess sub process.
Each subprocess uses the Binding Reference option on the Process Reference to act as a SOAP Service Consumer, of an available Bank Service.
This process acts as both a SOAP Service Provider for the mortgage broker and a SOAP Service Consumer for the Credit Check Service.
Bank_A_Process invokes the credit check service through "BankSubProcessForCreditCheck" sub process. This subprocess uses Binding Reference option, on the Process Reference, to act as a SOAP Service Consumer.

This process receives the details of the borrower from the mortgage broker and queries a credit check services to validate the borrower credentials. The bank can specify the borrower name. The process exposes services to the mortgage broker.
This process acts as both a SOAP Service Provider for the mortgage broker and a SOAP Service Consumer for the Credit Check Service.
Bank_C_Process uses Binding Reference-external option on the Process Reference, to act as a SOAP Service Consumer of the Credit check Service.
This process acts as a SOAP Service Provider for credit check functionality. It processes the request returns the credit rating for a customer.