Create Requests :

To create a new Rest request for a Transformer:

  1. Select the Rest type Transformer and click "New Request" on hover to create a request.
  2. Navigate to the created request & select it to configure.
  3. User will see three tabs L1, L2 & L3. L1 represents dynamically generated transformer request url's, In L2 we put request & response rules and in L3 we provide client request & response body for client's url.
  • Client url can be any valid url which will return the expected response.
  1. Now in L1 provide necessary data method, parameters, content type, body, headers.
  2. Transformer rules scripts can be applied using L2 tab.
  3. In L3 provide client url, content type, method, body etc.
  • If client content type is ISO then it will need an endpoint, port & a spec file.
  1. Save the configured request and Start the Transformer.

Execute Rest Request

To test a Rest Transformer request:

  1. Copy the URL of the desired Rest request within the Transformer.
  2. Go to the API module and Paste the Transformer request's URL.
  3. Provide any required data (body, method parameters, headers etc).
  4. Send the request.
  5. Compare the actual response to the expected response.
  • Make sure to start the Transformer after simulating a request.

Example :

We will simulate an Atm Transaction request, In which user will provide JSON payload and internally this request will execute client request with ISO payload data :

L1 request & response body :-

// L1 Request Body
{
    "card_number": "1234567890123456789",
    "amount_withdrawn": 100.00,
    "transaction_type": "withdrawal"
}

// L1 Response Body
{
    "transaction_id": "123456",
    "status": "success"
}

L3 request & response body :-

  • These below bodies have been used to create L3 request.
  • User can use these body and simulate an L3 ISO request using PruTAN's Hostbox module.
// L3 Request Body
<isomsg>
  <header/>
  <field id="0" value="0200"/>
  <field id="2" value="1234567890123456789"/>
  <field id="3" value="000000"/>
  <field id="4" value="000000010000"/>
</isomsg>

// L3 Response Body
<isomsg>
  <header/>
  <field id="0" value="0200"/>
  <field id="2" value="1234567890123456789"/>
  <field id="3" value="010000"/>
  <field id="39" value="00"/>
</isomsg>

  • Now follow above steps and execute this above simulated request in API module. User will get simulated response body as response after request execution.

  • For a detailed analysis of Transformer requests, users can check the Transformer's Analytics submenu.
  • Repeat these steps for different scenarios within the Transformer to thoroughly test your Rest APIs efficiently.