What is REST Web Service?

webserv_img

Ten or 15 years ago, when people talked about Web Services, you would immediately understand they were referring to SOAP. But these days, if someone says they have a Web Service interface, you need to follow up with the question: “What kind of Web Service – SOAP or REST? ” In fact,  REST is fast becoming the more visible application interface on the Internet.  This blog provides a quick overview of what REST is, and how it compares to SOAP.

Web Services

Firstly, like SOAP, REST is a Web Service, which by definition provides an Application-to-Application interface. So functionally, REST is similar to SOAP in that it enables a Client application to invoke an operation/method in a Server application . Furthermore, REST uses HTTP and HTTPS as the communication protocol, just as SOAP does. Their differences lie in what is underneath the cover.

webserver_flowchart

SOAP Web Service

One of the key underpinning of SOAP Web Service is the usage of XML in its:

  • Messaging protocol (SOAP)
  • Description of services (WSDL)
  • Actual data representation (payload)

webserver_flowdiaREST Web Service

Proponents of REST view XML as the major reason to move away from SOAP Web Service because of its verbosity: XML encoded data could increase the size of the message enormously.

So instead, REST Web Service embodies the following:

  • No standardized messaging protocol like SOAP
  • No standardized description of services like WSDL
  • Data are encoded in JSON (JavaScript Object Notation)

REST embraces the adoption of utilizing URL and HTTP protocol methods (verbs) to convey methods/operation.  So instead of using WSDL like in SOAP to convey exactly what the operation is, the standard HTTP verb is used “by convention” to convey what is needed.

UniformInterface

The perceived benefits of this approach are:

  • It eliminates the need of an XML Parser
  • JSON messages are smaller than XML messages
  • It eliminates the client application to understand how to handle SOAP protocol or interrupt the web service description

JSON_REST_HTTP_img

These are especially important factors in “lightweight” clients like mobile applications. This can be demonstrated by a simple example below, comparing a REST request with a SOAP request.

request

More to come

Does this mean that REST is always better than SOAP? Is REST limited to only mobile applications or JSON data? What is the significance of using REST with NonStop applications?

We will explore these and other questions in our next blogs.

Do you find this tutorial blog helpful? Let us know what you think, and how we can make it even better. Don’t forget, you can subscribe to our blogs (top right-hand corner of the home page) to get automatic email notification when a new blog is available.

Phil LyPhil Ly is the president and founder of TIC Software, a New York-based company specializing in software and services that integrate NonStop with the latest technologies, including Web Services, .NET and Java. Prior to founding TIC in 1983, Phil worked for Tandem Computer in technical support and software development.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>