DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Event-Driven Architecture Using Serverless Technologies
  • Integrating AWS With Salesforce Using Terraform
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • SRE vs. DevOps

Trending

  • Event-Driven Architecture Using Serverless Technologies
  • Integrating AWS With Salesforce Using Terraform
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • SRE vs. DevOps
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. SOAP vs. REST: Which is Best for You?

SOAP vs. REST: Which is Best for You?

There are a few differences between REST and SOAP. Read this article to find out why one person believes REST is better.

Ross Garrett user avatar by
Ross Garrett
·
Aug. 09, 18 · Opinion
Like (3)
Save
Tweet
Share
7.11K Views

Join the DZone community and get the full member experience.

Join For Free

Short answer, REST. Don't make your engineers and clients suffer by making them deal with SOAP/XML/WSDLs (Who doesn't love acronyms?). You don't want them to curse you, so make their lives easier. I know the idea of soap is clean and refreshing, but nothing in dealing with SOAP makes me feel clean or refreshed, only dirty and exhausted. And yes, this topic has been widely covered, but Cloud Elements prides itself on being the lynchpin of APIs so I figured we should probably have a post on this topic. Don't you feel lucky?

Let's start with SOAP. I'll keep this as unbiased as possible, but if you've read my other posts, you'll know that will last about 30 seconds. SOAP stands for Simple (HA!) Object Access Protocol. Its format is that of XML, which resembles that of HTML tags, *gag*. Well, I tried to keep it unbiased, but that didn't last long at all. SOAP was developed back in the 90's and thus is used in many legacy APIs. It is a stateful operation and is awesome if you care about all the changes to a given object, not just that it changed. Who doesn't love all the data? Your ISP and the host server. That amount of detail can decimate your bandwidth. SOAP is a standard as well. Meaning that there are rules to follow. Whereas REST is a set of guidelines left to be interpreted by the given engineer.

Now, it doesn't seem fair to just demean SOAP entirely. Though personally, I like REST, SOAP has some advantages. Since SOAP supports WS-Security, it offers more robust security. Want to more easily deal with Firewalls? SOAP's standard HTTP protocol makes firewalls become less of a hassle. Do you need ACID-compliant transactions? Well better learn to love XML, SOAP is the best/only option for this.

XML:

Now for the newer arrival, REST. REST stands for Representational State Transfer. It gets to use the easier to understand and write JSON format. Because it does not hold state, just like the rest of the web, it takes far less bandwidth. Hence why your mobile apps are almost entirely developed on the REST principles. I say principles because there is no standard. Just some guidelines. Follow them or don't, your call. SOAP requires you to follow a rigid format and protocol. Because it is more a guideline and uses JSON you can learn, and deploy it much faster than SOAP/XML. REST also uses the standard HTTP verbs (GET, POST, PATCH, PUT, DELETE). So if you're already familiar with those and understand how to write JSON, you're basically 99% on the way to writing an API.

REST:

So that's the basic breakdown. Fine, SOAP has some upshots. But those are outweighed by its legacy status, glutenous bandwidth needs, and XML format. If you are starting to build an API from scratch, consider that something like 70% of the web is now based on REST/JSON. Write one API endpoint in REST and another in SOAP and let me know where your sanity stands after each.

If you want an overview of JSON v. XML (and I know you just can't wait for that) read this related post.

SOAP Web Protocols REST

Published at DZone with permission of Ross Garrett, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Event-Driven Architecture Using Serverless Technologies
  • Integrating AWS With Salesforce Using Terraform
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • SRE vs. DevOps

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: