Module Structure
A module is a specific calculation request sent to the SCEX for computation. The core of this manual is a description of each module available in the SCE. This module declaration functions as a switchboard identifier which the SCEX uses to direct the request data to the appropriate colculation.
The SCEX make heavy use of default values in order to precisely represent a loan in question. This maximally scaled-down approach enhances human readability of the XML. Therefore, optional elements and attributes not required for a particular loan should be omitted from the input payload. This best-practice strategy makes understanding a particular loan much easier than having a voluminous and confusing sprawl of irrelevent data.
In general, elements provide structure whereas attributes fine-tune various options available for the element.
XML Request Structure
As a rule of thumb, the root element for an XML request payload is named in (for input) and the name of the module.
<inMODULE Attributes>
<!-- Data Elements -->
<Element_Data Attributes>data</Element_Data>
<!-- Empty Elements -->
<Element_Empty Attributes/>
<!-- Parent-Child Structures (usually optional) -->
<Parent_Element Attributes>
<Child_Element Attributes>data</Child>
</Parent_Element>
</inMODULE>
Below is a sample Loan Builder loan request with life protection, illustrating this structure:
<!-- Module Name requesting a Loan Builder calculation -->
<inLOAN_BUILDER>
<!-- Empty Elements (IntRate, Advance, Payment Stream) with attributes -->
<EditInterest Date="2024-12-01" AccrualCode="320" IntRate="5.000" />
<Advance Date="2024-12-01" Amount="10000.00" />
<PmtStream Begin="2025-01-01" Term="12" />
<!-- Parent: Loan Protection -->
<Protection>
<!-- Both Parent and Child: Life Protection -->
<Product Code="LI">
<!-- Child: Birthday of applicant -->
<Birthday>1966-04-16</Birthday>
</Product>
</Protection>
</inLOAN_BUILDER>
This common structure facilitates faster understanding of the SCEX modules.
XML Response Structure
Just as all xml module requests are preceded by in, their corresponding response root element name is preceded with an out plus the module name. The basic structure of an SCEX Response is as follows:
<outMODULE Attributes>
...
</outMODULE>
Though the SCEX has broad functionality, its current primary usage is in loan computation. Whether that loan module is LOAN_BUILDER, ARM, or any other, the structure of the output is as follows:
<outMODULE Attributes>
<Results>
<!-- Success, Failure, Warnings -->
<Description>*Success or Failure in the calculation request*</Description>
<XMLDetail>XML Error: An issue that caused the failure.</XMLDetail>
<XMLDetail>XML Warning: The calculation went through, but unexpected behavior is being reported.</XMLDetail>
<!-- One or more key numeric results. e.g. Payment -->
<Payment>326.55</Payment>
</Results>
</outMODULE>