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.
This process uses Process Reference option to invoke the Mortgage broker process. This options statically map the two Processes together.
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.
Each subprocess uses the Binding Reference option on the Process Reference to act as a SOAP Service Consumer, of an available Bank Service.
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.
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.
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.