GET API Example

This example shows how to create a GET service to query a subscriber.

<MtxRestServices xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns='http://www.matrixxsw.com/XML_Schema/rest_service'
    xsi:schemaLocation='http://www.matrixxsw.com/XML_Schema/rest_service
    http://www.matrixxsw.com/XML_Schema/rest_service.xsd rest_service.xsd ../rest_service.xsd'>
        <info>
            <class>extension</class>
            <filename>src/main/resources/rest/extension.xml</filename>
            <date>2019-06-19T15:25:27</date>
        </info>
        <path_array>
            <path url="/demo/subscriber/{SubscriberSearchTerm}">
                <service id="GET">
                    <name>demo_query_subscriber </name>
                    <description>Query the subscriber </description>
                    <request>DemoRequestSubscriberQuery </request>
                    <response>DemoResponseSubscriberQuery </response>
                    <parameters>
                        <UrlParameterArray>
                            <url_param>
                                <description>Default is the object id of the subscriber (line).
                                Qualifiers of ObjectId+, ExternalId+, AccessNumber+ can be specified.
                                </description>
                                <name>SubscriberSearchTerm</name>
                                <type>RestQueryTerm</type>
                            </url_param>
                        </UrlParameterArray>
                    </parameters>
                    <code_generation>
                       <mapping>readData</mapping>
                       <mapping>attachVersion 1</mapping>
                       <patch>route = setRoute(route, SubscriberSearchTerm)</patch>
                       <callout_statement>
                           com.matrixx.rsgateway.configuration.DemoServices svc = (com.matrixx.rsgateway.configuration.DemoServices )m_appContext.getBean("DemoServices");
                           svc.demoQuerySubscriber(SubscriberSearchTerm, reqMsg, rspMsg)
                       </callout_statement>
                    </code_generation>
                </service>
            </path>
        </path_array>