Create the Tax REST Service
In this task, you define the tax REST service, name the REST service and define a class name for the service, and define the URL of your call to handle how the input parameters are retrieved.
Before you begin
This task assumes that you are already editing the home/mtx/mtxsdk/projects/thinAirTax/schema/thinAirTax-schema.xml file.
Procedure
-
Define the REST call.
Note: The REST call definition follows the MDC relationship definition and must be between the <container_relationship> </container_relationship> nodes.
Add the following code.
<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> <patch>route = setRoute(route, SearchTerm)</patch> <callout_statement>com.matrixx.rsgateway.configuration.TaxationService svc = (com.matrixx.rsgateway.configuration.TaxationService) m_appContext.getBean(“TaxationService”); </callout_statement> </REST_service> </relationship> </container_relationship>
- Save the file.