Create a Private Request MDC

In this task, you create a custom MATRIXX Data Container (MDC) to hold the information that comprises the REST request. This custom offer purchase request for a subscriber defines the information needed to find the subscriber and to select an offer.

About this task

All REST requests are derived from the out-of-the-box MtxRequest MDC.

Procedure

  1. Edit the projects/purchase/src/main/resources/extension-rest-mdc.xml file.
  2. Define the private request MDC with five fields (SubscriberSearchData, Offer, Type, Amount, and Color).

    You must define all MDC definitions and REST calls within the <configuration> … </configuration> nodes. Add the following code.

    <container id="DemoRequestSubscriberPurchase">
        <doc_description>Demonstration of a custom offer purchase</doc_description>
        <created_schema_version>2</created_schema_version>
        <base_container id="2">MtxRequest</base_container>
        <field id="SubscriberSearchData">
            <created_schema_version>2</created_schema_version>
            <doc_description>Subscriber search data structure</doc_description>
            <doc_required/>
            <datatype>struct</datatype>
            <struct_id>MtxSubscriberSearchData</struct_id>
        </field>
        <field id="Offer">
            <created_schema_version>2</created_schema_version>
            <doc_description>Offer being purchased.</doc_description>
            <doc_required/>
            <datatype>struct</datatype>
            <struct_id>MtxPurchasedOfferData</struct_id>
        </field>
        <field id="Type">
            <created_schema_version>2</created_schema_version>
            <doc_description>Type of offer being created.</doc_description>
            <datatype>string</datatype>
            <max_size>15</max_size>
        </field>
        <field id="Amount">
            <created_schema_version>2</created_schema_version>
            <doc_description>Amount of the offer.</doc_description>
            <datatype>decimal</datatype>
        </field>
        <field id="Color">
            <created_schema_version>2</created_schema_version>
            <doc_description>Color of the offer.</doc_description>
            <datatype>string</datatype>
            <max_size>15</max_size>
        </field>
        <storage_size>large</storage_size>
    </container>
  3. Save the file.

What to do next

Create the private response MDC.