Final Tax Schema Definition

The following code shows the complete thinAirTax-schema.xml definition for the request and response MATRIXX Data Containers (MDCs), the MDC relationship definition, and the REST call. In this schema definition, the thinAirTax class is created to use a bean managed by the Spring object manager.

<configuration>
    <subtype id='TaxTreatmentCode'>
        <datatype>unsigned int32</datatype>
        <value id='1'>inclusive</value>
        <value id='2'>exclusive</value>
    </subtype>
    <container id='TaxComputeRequest'>
        <doc_description>Request container for tax computation.</doc_description>
        <created_schema_version>5050</created_schema_version>
        <base_container id="5050">MtxRequest</base_container>
        <field id='MsgId'>
            <doc_description>Message Id</doc_description>
            <datatype>string</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='CustomerType'>
            <doc_description></doc_description>
            <datatype>signed int32</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='Location'>
            <doc_description>A geo-location code</doc_description>
            <datatype>string</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='GrossPrice'>
            <doc_description></doc_description>
            <datatype>decimal</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='DiscountPrice'>
            <doc_description>Service type</doc_description>
            <datatype>decimal</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='TaxTreatment'>
            <doc_description></doc_description>
            <datatype>unsigned int32</datatype>
            <created_schema_version>5050</created_schema_version>
            <subtype_reference>TaxTreatmentCode</subtype_reference>
        </field>
        <field id='Group'>
            <doc_description>Company group division</doc_description>
            <datatype>string</datatype>
            <created_schema_version>5050</created_schema_version>
        </field>
        <field id='GroupItemArray'>
            <doc_description>Source host</doc_description>
            <datatype>string</datatype>
            <created_schema_version>5050</created_schema_version>
            <array>1</array>
        </field>
    </container>
    <container id='TaxComputeResponse'>
        <doc_description>Response to tax computation</doc_description>
        <created_schema_version>5050</created_schema_version>
        <base_container id="5050">MtxResponse</base_container>
    </container>
    <container_relationship id='op_return_type'>
        <relationship id='TaxComputeRequest'>
            <target_container>TaxComputeResponse</target_container>
            <REST_service>
                <name>compute_tax</name>
                <description>Compute taxes</description>
                <class>thinAirTax</class>
                <url>/thinAirTax/compute</url>
                <method>POST</method>
                <mapping>readData</mapping>
                <mapping>attachVersion 1</mapping>
                <callout_statement>com.matrixx.rsgateway.configuration.TaxationService svc =
                com.matrixx.rsgateway.configuration.TaxationService) m_appContext.getBean(“TaxationService”);</callout_statement>
                <callout_statement>svc.computeTax(reqMsg, rspMsg);</callout_statement>
            </REST_service>
        </relationship>
    </container_relationship>
</configuration>