This spike illustrates how to use Spring Integration library to implement a REST wrapper for the CurrencyName SOAP endpoint, where the endpoint is provided by DataFlex Web Service which is available to the public. The CurrencyName endpoint converts a currency code (e.g. JPY) into a currency name (e.g. Yen).
- Run the rest-to-soap spring boot application
cd modules/rest-to-soap
./mvnw clean spring-boot:run
- Call the REST API with curl and expected "Yen" to be returned
curl -u hung:pass1234 -v -s "http://localhost:8080/api/currencyname?code=jpy"
- The REST controller handles many incoming requests simultaneously, all these requests are sent to a single request message channel, and all the SOAP responses are returned to the REST controller via a single reply message channel. To map the message received from the reply message channel to the corresponding REST request, the message gateway plays an important role here. To test this scope mapping, a Jmeter test plan has been included in this spike which performs the load test to the REST controller.
- Download and extract Jmeter
- Install the Jmeter Plugin Manager
- Launch the Plugin Manager in Jmeter, and install the Random CSV Data Set
- load the test plan in "/jmeter/load-test.jmx"
- Expand the test plan tree, adjust the Filename parameter under the bzm - Random CSV Data Set Config step
- Check the test result in Summary Report and View Result Tree
curl -u hung:pass1234 -v -s http://localhost:8080/api/echo\?ping\=hung
curl -u hung:pass1234 -v -s http://localhost:8080/api/upper\?value\=hung