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
Helium Price Prediction | Is HNT a Good Investment?
How to transfer money from USA to India without tax?
Lexi Vonn
It may surround a charged particle Crossword Clue
Dricxzyoki
Gamevault Agent
Overnight Cleaner Jobs
Nc Maxpreps
Trade Chart Dave Richard
Bank Of America Appointments Near Me
Locate Td Bank Near Me
Uc Santa Cruz Events
Robot or human?
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Https://Gw.mybeacon.its.state.nc.us/App
Chile Crunch Original
Love In The Air Ep 9 Eng Sub Dailymotion
Youravon Comcom
Connect U Of M Dearborn
Razor Edge Gotti Pitbull Price
Shasta County Most Wanted 2022
Whitefish Bay Calendar
H12 Weidian
Daytonaskipthegames
Chaos Space Marines Codex 9Th Edition Pdf
The Banshees Of Inisherin Showtimes Near Broadway Metro
Creed 3 Showtimes Near Island 16 Cinema De Lux
Medline Industries, LP hiring Warehouse Operator - Salt Lake City in Salt Lake City, UT | LinkedIn
Leben in Japan – das muss man wissen - Lernen Sie Sprachen online bei italki
Craigslist Brandon Vt
Sandals Travel Agent Login
Jesus Calling Feb 13
APUSH Unit 6 Practice DBQ Prompt Answers & Feedback | AP US History Class Notes | Fiveable
Yoshidakins
Amici Pizza Los Alamitos
Goodwill Thrift Store & Donation Center Marietta Photos
Maybe Meant To Be Chapter 43
Best Workers Compensation Lawyer Hill & Moin
Soulstone Survivors Igg
When His Eyes Opened Chapter 2048
Cheetah Pitbull For Sale
Www.craigslist.com Waco
Brandon Spikes Career Earnings
Best Restaurants West Bend
Sdn Fertitta 2024
Lyndie Irons And Pat Tenore
New Starfield Deep-Dive Reveals How Shattered Space DLC Will Finally Fix The Game's Biggest Combat Flaw
Mit diesen geheimen Codes verständigen sich Crew-Mitglieder
Wera13X
Jovan Pulitzer Telegram
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.