IBM i Webservices – REST vs. SOAP 

 September 18, 2017

By  NickLitten

[thrive_headline_focus title=”Lets start with this ‘REST vs SOAP is not the right question to ask you silly billy!'” orientation=”left”]

SOAP is a protocol – REST is an architectural style (a design for network-based software architectures)

REST concepts are referred to as resources. A representation of a resource must be stateless. It is represented via some media type. Some examples of media types include XML, JSON, and RDF. Resources are manipulated by components. Components request and manipulate resources via a standard uniform interface. In the case of HTTP, this interface consists of standard HTTP ops e.g. GET, PUT, POST, DELETE.

I like this analogy of comparing SOAP vs REST – if you are going to mail a message to someone, SOAP would be a Manila Envelope and REST would be a postcard. SOAP is a securely sealed up message with overheads for both the sender and receiver (meaning wrapping it up, opening message, sorting and reading the papers in the envelope). REST is a quick easy to read message that relies on the security of the transport, in this analogy the mailman is HTTPS (SSL). So you can assume the mailman only speaks bong-bongo and cannot read your postcard.

So the biggest advantages for REST over SOAP are:

REST is more dynamic, no need for creating and updating UDDI (UDDI is an XML-based standard for describing, publishing, and finding web services). REST is not restricted to XML format. REST web services can send plain text, JSON, and also XML.

Sending data over the network in Json format is cheaper than sending it in Xml format in terms of payload. JSON is quicker, shorter and easier to read than XML.

SOAP is a protocol. REST is an architectural style.
SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer.
SOAP (as a protocol) cannot use REST. REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.
SOAP uses webservice interfaces to expose the business logic. REST uses URI to expose business logic.
SOAP uses strict standards to follow. REST does not and its much more loosey goosey.
SOAP is fatter and therefore requires more bandwidth and resource than REST. REST being skinnier is quicker than SOAP.
SOAP defines its own security. RESTful web services inherits security measures from the underlying transport (ie: HTTPS SSL).
SOAP permits XML data format only. REST permits different data format such as Plain text, HTML, XML, JSON etc.

UPDATE: I found this amusingly crap infographic which sums it up nicely:

IBM i Webservices - REST vs. SOAP 1


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

I’m always looking for awesome input, feedback and critique!