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
Result
The response is printed to the console and to disk in the output.log file. The response contents are either response from Mortgage Broker:Name: John: Status: REJECTED, or response from Mortgage Broker:Name: John : Status: APPROVED.
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:
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.
![](GUID-10AD0A98-4A6C-420D-9CA0-5C7C8526C808-display.png)
This process uses Process Reference option to invoke the Mortgage broker process. This options statically map the two Processes together.
![](GUID-605D56B9-EC69-4E25-B065-6BB140DEEF3A-display.png)
mortgageBroker.LoanRequestProcess
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.
![](GUID-AD3168F2-DB54-447B-83A6-8F8C6519223C-display.png)
Each subprocess uses the Binding Reference option on the Process Reference to act as a SOAP Service Consumer, of an available Bank Service.
![](GUID-B6CC6EA3-6FB6-41A1-9F6B-32FCA10FA11E-display.png)
banks.bank_A.Bank_A_Process
This process acts as both a SOAP Service Provider for the mortgage broker and a SOAP Service Consumer for the Credit Check Service.
![](GUID-3888AFFA-1006-4BDB-B608-6286DBC77EC5-display.png)
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.
![](GUID-02B01487-4F21-4563-A9F2-50B7BCB5F39D-display.png)
creditCheck.CreditCheck
This process acts as a SOAP Service Provider for credit check functionality. It processes the request returns the credit rating for a customer.