What is SOA and Web Services?

Most applications are developed to interact with users; the user enters or searches for data through an interface and the application then responds to the user's input. A Web service does more or less the same thing except that a Web service application communicates only from machine to machine or application to application. There is often no direct user interaction. A Web service basically is a collection of open protocols that is used to exchange data between applications. The use of open protocols enables Web services to be platform independent. Software that are written in different programming languages and that run on different platforms can use Web services to exchange data over computer networks such as the Internet. In other words, Windows applications can talk to PHP, Java and Perl applications and many others, which in normal circumstances would not be possible.


There are several design models for web services, but the two most dominant are SOAP and REST.

REST

REST – Representational State Transfer – is quickly becoming the preferred design model for public APIs. Some interesting statistics regarding the growth of REST in the public sphere are available at, for example, the Programmable Web. REST is an architectural style, unlike SOAP which is a standardized protocol. REST makes use of existing and widely adopted technologies, specifically HTTP, and does not create any new standards. It can structure data into XML, YAML, or any other machine readable format, but usually JSON – JavaScript Object Notation – is preferred. As can be expected from JavaScript, the objects are not strongly typed. REST follows the object oriented programming paradigm of noun-verb. REST is very data-driven, compared to SOAP, which is strongly function-driven. In the REST paradigm, metadata is structured hierarchically and represented in the URI; this takes the place of the noun. The HTTP standard offers several verbs representing operations or actions you can perform on the data, most commonly: GET, POST, PUT, and DELETE.

SOAP

SOAP – Simple Object Access Protocol – is probably the better known of the two models. SOAP relies heavily on XML, and together with schemas, defines a very strongly typed messaging framework. Every operation the service provides is explicitly defined, along with the XML structure of the request and response for that operation. Each input parameter is similarly defined and bound to a type: for example an integer, a string, or some other complex objects. All of this is codified in the WSDL – Web Service Description (or Definition, in later versions) Language. The WSDL is often explained as a contract between the provider and the consumer of the service. In programming terms the WSDL can be thought of as a method signature for the web service.


Benefits of Web Services


Based on industry standards

Once a software developer learns how to use a web service, the learning curve is greatly reduced for other web services that follow the standards.


Development tool independence

Any development tool that supports the web service standard should be able to access the data and services provided by the web service.


Insulation from future changes

Web services attempt to keep the web service interface unchanged, even though the data and code behind the web service may change in future versions of a product. This helps applications that use the web service to continue working properly, even though the application behind the web service has changed.


Secure access to data

Web services can tightly control access to the data and services they make available to other applications.