deepak-rajpal
10/15/2015 - 3:59 PM

Intro to Web Services - Soap and Rest APIs

Intro to Web Services - Soap and Rest APIs

Web services 
A Web service, in very broad terms, is a method of communication between two applications or electronic devices over the World Wide Web (WWW). Web services are of two kinds: Simple Object Access Protocol (SOAP) and Representational State Transfer (REST).

SOAP
SOAP defines a standard communication protocol (set of rules) specification for XML-based message exchange. SOAP uses different transport protocols, such as HTTP and SMTP. The standard protocol HTTP makes it easier for SOAP model to tunnel across firewalls and proxies without any modifications to the SOAP protocol.

The Web Services Description Language (WSDL) contains and describes the common set of rules to define the messages, bindings, operations and location of the Web service. WSDL is a sort of formal contract to define the interface that the Web service offers.

REST
REST is protocol independent. REST-based implementation is simple compared to SOAP. The service producer and service consumer need to have a common understanding of the context as well as the content being passed along as there is no standard set of rules to describe the REST Web services interface.

REST is a simple way to organize interactions between independent systems. It's been growing in popularity since 2005, and inspires the design of services, such as the Twitter API.

OAuth 2.0 
OAuth 2.0 is an open authorization protocol which enables applications to access each others data. For instance, a game application can access a users data in the Facebook application, or a location based application can access the user data of the Foursquare application etc.
http://tutorials.jenkov.com/oauth2/index.html

References:
Twitter Rest APIs - https://dev.twitter.com/rest/public
Paypal Rest APIs - https://developer.paypal.com/docs/api/overview/
http://www.restapitutorial.com/lessons/restquicktips.html
http://www.javatpoint.com/soap-vs-rest-web-services
http://searchsoa.techtarget.com/tip/REST-vs-SOAP-How-to-choose-the-best-Web-service