This repository contains a module with two sample interceptors where the Request Interceptor converts a xml payload to a json payload and the Response Interceptor converts a json payload to a xml payload.
- jsonToXmlFormatter.bal - A response interceptor which converts a JSON payload to a XML payload.
- xmlToJsonFormatter.bal - A request interceptor which converts a XML payload to a JSON payload.
- formatterInterceptorTest.bal - contains test functions for the request and response interceptors.