1. What is a Web service?
Web services are web application components.
Web services can be published, found, and used on the Web.
Web services are client and server applications that communicate over the World Wide Webs
(WWW) HyperText Transfer Protocol (HTTP). As described by the World Wide Web Consortium
(W3C), web services provide a standard means of interoperating between software applications
running on a variety of platforms and frameworks. Web services are characterized by their great
interoperability and extensibility, as well as their machine-processable descriptions, thanks to the use
of XML. Web services can be combined in a loosely coupled way to achieve complex operations.
Programs providing simple services can interact with each other to deliver sophisticated added-value
services.
As you can see in the fi gure, java, .net or PHP applications can
communicate with other applications through web service over the
network. For example, java application can interact with Java, .Net
and PHP applications. So web service is a language independent way
of communication.
Types of webservices.
SOAP web services.
RESTful web services.
SOAP Web Services
SOAP stands for Simple Object Access Protocol. It is a XML-based
protocol for accessing web services. SOAP is a W3C recommendation
for communication between two applications.
SOAP is XML based protocol. It is platform independent and language
independent. By using SOAP, you will be able to interact with other
programming language applications.
Language and Platform independent : SOAP web services can be
written in any programming language and executed in any platform.
RESTful Web Services
REST stands for Representational State Transfer. REST is an architectural
style not a protocol.
Advantages of RESTful Web Services
Fast: RESTful Web Services are fast because there is no strict
specification like SOAP. It consumes less bandwidth and resource.
Language and Platform independent : RESTful web services can be
written in any programming language and executed in any platform.
No
SOAP
REST
SOAP is a protocol.
REST is an architectural style.
SOAP stands for Simple Object
Access Protocol.
REST stands for REpresentational
State Transfer.
SOAP can't use REST because
it is a protocol.
REST can use SOAP web services
because it is a concept and can use
any protocol like HTTP, SOAP.
SOAP uses services interfaces
to expose the business logic.
REST uses URI to expose
business logic.
SOAP defines standards to be
strictly followed.
REST does not define too much
standards like SOAP.
SOAP defines standards to be
strictly followed.
REST does not define too much
standards like SOAP.
SOAP requires more
bandwidth and resource than
REST.
SOAP defines its own security. RESTful web services inherits
security measures from the
underlying transport.
SOAP permits XML data format
only.
10
SOAP is less preferred than
REST.
2. Diagram examples
REST requires less bandwidth and
resource than SOAP.
REST permits different data format
such as Plain text, HTML, XML,
JSON etc.
REST more preferred than SOAP.