How to turn a SOAP Service into a REST API

This configuration demonstrates how Membrane can be utilized to transform a SOAP service into a REST API.



SOAP messages require the use of POST, so we set the method using groovy. Through template we create the request body containing the SOAP message with a placeholder for the city name parameter from the REST request and send it to the SOAP service at The response is converted from XML to JSON for further processing, mapping the SOAP response fields country and population to JSON keys. This setup allows clients to interact with the SOAP service using a RESTful interface, avoiding the need to handle SOAP directly.

<api port="2000">
    <template contentType="application/xml">
        <s:Envelope xmlns:s="" xmlns:c="">
    <template contentType="application/json">
        "country": "${json["s:Envelope"]["s:Body"]["cs:getCityResponse"]["country"]}",
        "population": "${json["s:Envelope"]["s:Body"]["cs:getCityResponse"]["population"]}"
    <xml2Json />
  <target url="" />
curl localhost:2000?name=Bonn

    "country": "Germany",
    "population": "327000"


groovy Examples Documentation
template Examples Documentation
xml2Json Examples Documentation
city-service WSDL