Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 2.51 KB

File metadata and controls

50 lines (33 loc) · 2.51 KB

REST to SOAP wrapper with Spring Integration

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).

How to run this spike

  • 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"

Highlight features

  • 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.

Setup Jmeter for testing

Run the Jmeter test plan

  • 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

Reference

For calling other API

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