Search code examples
apirestapigeewso2-api-manager

Is wrapping SOAP/JMS as REST using API Mgmt. tools practical?


Is wrapping SOAP/JMS as RESTful API using API Mgmt. tools practical?

API management tools like apigee and wso2 –am claim support for exposing SOAP services as REST-JSON but practically I find it difficult to map the two and do not see a value add that we can bring say by exposing all our SOAP/JMS resources over a Restful API Mgmt. tool. SOAP services are structurally very different from REST where you can have a set of multiple operations with possible lot of request and response elements mapping to business cases usually.

REST on the other hand is based on four HTTP verbs GET, POST, PUT and DELETE which are to be handled tactfully to handle defined resources. What design principle can we use to do the mapping?

For example, Implementing above translation might require adding a lot of xml content to your HTTP header for a GET request and later processing it which is not a standard implementation of HTTP and REST.

Thanks, Wajid


Solution

  • As Ian said, SOAP services often do not map directly into RESTful APIs. I do not know of any SOAP-to-REST conversion tools provided by any vendor that will automatically create a beautiful, RESTful API from a set of SOAP services.

    Assuming you intend to expose your RESTful API to many developers, and/or care about how usable (beautiful, I'd argue) it is, my recommendation would be to design the RESTful API by analyzing the resources you are trying to encapsulate in the RESTful API without worrying about the SOAP services you have. Assuming you can map the domain into resources, you can come up with a usable, intuitive RESTful interface.

    Then, when you are happy with the RESTful API, use the SOAP services as building blocks. The API Management layer should, as Ian explained, help you convert your RESTful input into SOAP requests, mash up multiple calls, extract information from the responses into your chosen response payloads, and help you secure and scale your API. If you find you need to compromise on your RESTful API design due to inability to compose the SOAP building blocks into the desired RESTful interface, at least you will understand where you are compromising.