How to Turn Any SOAP Web Service into a REST API (2024)

by Terence Bennett • June 3, 2024

How to Turn Any SOAP Web Service into a REST API (1)

Table of contents

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.


Who Is This For?

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.

How To Convert SOAP to REST

The steps are truly very simple to follow.

  • Locate The API
  • Define A WSDL URI
  • View The API Docs
  • Utilize The Requests

#1 Locate The API

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.

#2 Define A WSDL URI

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:

https://www.w3schools.com/xml/tempconvert.asmx?WSDL

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.

#3 View The API Docs

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.

#4 Utilize The Requests

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.

Why Use This Method?

How to Turn Any SOAP Web Service into a REST API (2)

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.

Simplicity

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.

Security

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.

Transforming Data: Using DreamFactory’s Scripting Capabilities

Transforming data between SOAP and REST formats is a common requirement when integrating legacy systems with modern web applications. DreamFactory provides robust scripting capabilities that enable developers to manipulate and transform data easily. By leveraging DreamFactory’s scripting options, such as Node.js, PHP, and Python, you can create custom logic to handle the complexities of SOAP to REST conversions efficiently.

Why Transform Data?

SOAP and REST APIs often have different data formats and structures. SOAP uses XML for its message format, while REST typically uses JSON. To ensure seamless communication between these two API types, data must be transformed from one format to another. This transformation ensures compatibility and allows modern applications to interact with legacy SOAP services without issues.

Scripting in DreamFactory

DreamFactory supports server-side scripting in multiple languages, including Node.js, PHP, and Python. These scripts can be executed at various points in the API request/response lifecycle, allowing for flexible and powerful data transformations.

SOAP and REST Made Simple With DreamFactory

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:

SQL Server

Postgres

MySQL

Frequently Asked Questions: Converting SOAP to REST

What are the steps to convert SOAP to REST using DreamFactory?

The steps are:

  • Locate the SOAP API you want to work with.
  • Define a WSDL URI for the API in the DreamFactory Config tab.
  • DreamFactory will generate live API docs in Swagger for your REST-based API.
  • Utilize the requests available in the generated API docs to interact with the SOAP API through REST endpoints.

What are the benefits of using REST endpoints?

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.

How does DreamFactory enhance API management?

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.

Why is this method particularly useful for security?

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.

What are the overall advantages of implementing this method with APIs?

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.

How to Turn Any SOAP Web Service into a REST API (4)

Terence Bennett, CEO of DreamFactory, has a wealth of experience in government IT systems and Google Cloud. His impressive background includes being a former U.S. Navy Intelligence Officer and a former member of Google's Red Team. Prior to becoming CEO, he served as COO at DreamFactory Software.

How to Turn Any SOAP Web Service into a REST API (2024)
Top Articles
Naruto: 7 Characters That Naruto Couldn't Beat On His Own, Ranked
THE IMPORTANCE OF A BILL OF LADING IN INTERNATIONAL TRADE
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5846

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.