An Example of a Loan Processing Service Using Globus Toolkit for Grid Services

1. Introduction

The article illustrates the use of the Open Grid Services Infrastructure (OGSI) software model. A simple application from the Mortgage Industry dealing with Loan Payment Processing is used as an example to show how using the Globus toolkit (GT3.2) can transparently offer a new way of deploying software within a corporation. Every month, a mortgage borrower remits a principal and interest payment based on the loan’s amortization schedule. The Unpaid Principal Balance (UPB) of a loan is reduced by the scheduled principal payment amount, principal prepayment amount, and curtailment amount. Different services in a Mortgage Finance corporation will need access to this information. A typical example is the accounting resulting for the loan activity. This article will take the reader through a full implementation of a very simple Loan Processing Service using the Globus toolkit. The example simulates creating a loan, accepting principal payments for the loan, and querying the state of the loan. Although this is a very simple example, it can be extended to implement complex calculations or business scenario using the Globus toolkit.

You use the Top-Down Approach [1] to create the Grid Service. This approach starts by providing a GSWDL file that contains the abstract definition of the service including the types, message, and portType parts of WSDL. Using the tools that come with the GT3 installation generates the binding and service part. The next step with this approach is to provide the implementation of the interfaces. This article assumes familiarity with the concepts of Grid computing and Web services (see References for more information).

2. Port Type and Type Interfaces

These port types are defined in a file, loan.gwsdl. It describes the three operations: createLoan, processLoanPayment, and getLoan that the Loan Processing Service will provide:

Listing 1: loan.gwsdl file

   <xsd:element name="createLoan">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="loanNumber" type="xsd:int"/>
            <xsd:element name="amountUPB" type="xsd:double"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
   <xsd:element name="createLoanResponse">
      <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="returnValue" type="xsd:int"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name="processLoanPayment">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="loanNumber" type="xsd:int"/>
            <xsd:element name="amount" type="xsd:double"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
   <xsd:element name="processLoanPaymentResponse">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="returnValue" type="xsd:int"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>


   <xsd:element name="getLoan">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="loanNumber" type="xsd:int"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
   <xsd:element name="getLoanResponse">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="returnValue" type="domain:LoanType"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

</xsd:schema>
</types>

<message name="CreateLoanInputMessage">
   <part name="parameters" element="tns:createLoan"/>
</message>
<message name="CreateLoanOutputMessage">
   <part name="parameters" element="tns:createLoanResponse"/>
</message>

<message name="ProcessLoanPaymentInputMessage">
   <part name="parameters" element="tns:processLoanPayment"/>
</message>
<message name="ProcessLoanPaymentOutputMessage">
   <part name="parameters" element="tns:processLoanPaymentResponse"/>
</message>

<message name="GetLoanInputMessage">
   <part name="parameters" element="tns:getLoan"/>
</message>
<message name="GetLoanOutputMessage">
   <part name="parameters" element="tns:getLoanResponse"/>
</message>

<gwsdl:portType name="LoanPortType" extends="ogsi:GridService">
   <operation name="createLoan">
      <input message="tns:CreateLoanInputMessage"/>
      <output message="tns:CreateLoanOutputMessage"/>
      <fault name="Fault" message="ogsi:FaultMessage"/>
   </operation>
   <operation name="processLoanPayment">
      <input message="tns:ProcessLoanPaymentInputMessage"/>
      <output message="tns:ProcessLoanPaymentOutputMessage"/>
      <fault name="Fault" message="ogsi:FaultMessage"/>
   </operation>
   <operation name="getLoan">
      <input message="tns:GetLoanInputMessage"/>
      <output message="tns:GetLoanOutputMessage"/>
      <fault name="Fault" message="ogsi:FaultMessage"/>
   </operation>

</gwsdl:portType>

Additionally, you provide a loan.xsd file that defines the Loan Type that is used as a business object.

Listing 2: Loan Type schema file

<complexType name="LoanType">
   <sequence>
      <element name="loanNumber" type="int"/>
      <element name="UPB" type="double"/>
      <element name="status" type="string"/>
      <element name="createDate" type="string"/>
   </sequence>
</complexType>

More by Author

Must Read