by • August 2, 2023
There are two types of remote web services: REST APIs and SOAP APIs
If you want to wrap a SOAP API and make it easier to work with through the use of REST endpoints, this simple tutorial will enable you to achieve that goal.
With this process, you’ll be able to make a request with JSON to the API and receive a response in JSON instead of a long-winded XML format. In turn, your team will save time and cut out delays and frustration thanks to the simple and effective process that will result from this simple change.
Table of Contents
The use case here is a team that has a SOAP API and wants to wrap that API in REST so that you can call it with ease.
There are many applications where you’re likely to find this useful and, in fact, just about every team out there that works with such APIs will probably benefit from going through this simple process.
The steps are truly very simple to follow.
Begin by locating the API that you want to work with.
If starting from scratch, go to Create and select SOAP Service then fill in all the information. Give it a name, label, and a short description before making it active.
We’re going to use an example named temp with the label Temperature and a short description explaining that it’s a SOAP service capable of doing a temperature conversion.
At the base level, all you really need to do is provide a WSDL URI in the Config tab for the service you are attempting to work with.
For our example, we’ll use:
This is a simple public one that you could use. It will give you a working web service wrapped with REST and live documented with Swagger.
Once you save your URI in DreamFactory, it will create live API docs in Swagger that are completely REST-based.
Scroll down the list and locate the API you’re working with. When you click on it, some endpoints will appear. The number of endpoints you have available to you will depend on the specific API that you are working with.
Our example happens to have two endpoints, both of which we can use with ease directly in the DreamFactory dashboard.
With our example, we can do a quick Get request to see what’s available. This will show us things like the calls we can make with our API.
In our example, we have two options. First, we can convert a given temperature with a Celsius to Fahrenheit conversion. The other option is to convert a temperature with a Fahrenheit to Celsius conversion.
Therefore, this option gives us two Post request options (Celsius to Fahrenheit or Fahrenheit to Celsius). Selecting one of these Post requests will populate the body post and enable us to get the information we need.
You can probably already brainstorm a multitude of reasons why your team might choose to utilize this method. However, the two most obvious ones that stretch across the board are simplicity and security.
These are benefits that every single use case will see upon implementing this method into their workflow.
As you can see from our example, using this method makes things extremely simple. Not only are requests suddenly quick and easy, your APIs will be quickly locatable through the DreamFactory dashboard and so much simpler to manage for you and your team.
Overall, implementing this method to use with your APIs will make workflows so much faster for everyone who has to work with them regularly. This method negates the need for long-winded XML requests and makes managing your databases much more convenient and efficient overall.
Beyond simplicity, another benefit of using this method is security. This security can be achieved through the role access functions.
Once you have wrapped your SOAP API, you can then have end users who have sessions and you can have any number of roles. Those users will have role associations for role-based access control.
To control this, head to Roles and select one from the list. Under the Access tab for a specific role, you can assign services to the role by pressing the + icon. Select the service from the drop-down list to assign it.
This gives you a number of security benefits when wrapping a SOAP API in REST endpoints with the DreamFactory system.
Sign up for our free 14 day hosted trial to learn how.
With this simple setup, you can basically take any WSDL and just put that WSDL URL in. Upon saving your settings, it will auto-generate the endpoints in Swagger. With that, your applications will simply be able to call that REST API whenever you put them to use. It does it all for you!
DreamFactory strives to make the process as simple and straightforward as possible. This tutorial should enable you to get everything setup and functioning correctly without any delays or hurdles. The steps are rather easy to follow so long as you do everything in the right order.
In addition to wrapping SOAP APIs with a REST endpoint, DreamFactory supports adding REST APIs on top of popular databases such as:
The steps are:
Using REST endpoints offers simplicity and security. It simplifies API requests, making them quick and easy to manage. Additionally, security benefits can be achieved through role access functions, allowing control over user access to specific services.
DreamFactory simplifies API management by providing a user-friendly dashboard where you can easily locate and manage your APIs. It transforms SOAP APIs into REST-based APIs with live API docs in Swagger, streamlining workflows and making databases more accessible and efficient.
When you wrap a SOAP API in REST endpoints with DreamFactory, you can implement role-based access control. This means you can assign different roles to end users and control their access to specific services, enhancing security and data protection.
The advantages include faster workflows, simplified API requests, enhanced security, and better management of APIs for your team. This method removes the complexity of dealing with long-winded XML requests and makes using and managing APIs more convenient for everyone involved.
Terence Bennett, General Manager at DreamFactory, has a strong operational, business, and extensive experience in government IT systems and Google Cloud. He started his career as a U.S. Navy Intelligence Officer, then honed his skills on Google’s Red Team and later became the COO of Integrate.io.
Join the DreamFactory newsletter list.