Web Service:
Web service is a client
server application and method of communication between two devices or
applications over network. Web service can be implemented in many
languages like Php, .net, Java etc. and it can be access by any language client
application in short there is no dependence of language to access web services.
There are mainly two types
of web services.
1)
SOAP web
services.
2)
RESTful web
services.
SOAP web services:
SOAP stands for Simple
Object Access Protocol. It is a XML-based protocol for accessing web services.
SOAP provides the
envelope for sending Web Services messages over the Internet/Internet. It
is part of the set of standards specified by the W3C
The SOAP envelope
contains two parts:
1)
An
optional header providing information on authentication, encoding of data, or
how a recipient of a SOAP message should process the message.
2)
The
body that contains the message. These messages can be defined using the WSDL
specification.
SOAP defines its
own security known as WS Security and SOAP is a W3C recommendation for
communication between two applications.
RESTful web services:
REST stands for
REpresentational State Transfer and it is the software architectural style of the World Wide Web.
REST has become
one of the most important technologies for Web applications. Its importance is
likely to continue growing quickly as all technologies move towards an API
orientation. Every major development language now includes frameworks for
building RESTful Web services. As such, it is important for Web developers and
architects to have a clear understanding of REST and RESTful services.
RESTful Web
Services are fast because there is no strict specification like SOAP. It
consumes less bandwidth and resource.
RESTful web
service permits different data format such as Plain Text, HTML, XML and JSON
REST vs SOAP:
If we compare
both web services both have their own advantage and disadvantages. It cannot be
said which one is best it totally depend on what is requirement of application
and what kind of secure communication going to be used in application.
Here is comparison
in both web services
1)
SOAP
stands for Simple Object Access Protocol. REST stands for REpresentational
State Transfer.
2)
SOAP
is a XML based messaging protocol and REST is not a protocol but an
architectural style and it allows Plain Text, HTML, XML and JSON.
3)
REST follows stateless model whereas SOAP has
specifications for stateful implementation as well.
4)
SOAP
has a set of standard specifications. WS-Security is the specification for
security in the implementation. It is a detailed standard providing rules for
security in application implementation. Like this we have separate specifications
for messaging, transactions etc. Whereas REST does not has dedicated concepts
for each of these. REST predominantly relies on HTTPS.
5)
REST
requires HTTP for transport, SOAP is independent from a specific transport type.
6)
SOAP
supports distributed communication whereas REST assumes communication between
only two endpoints.
7)
REST
supports scalability better than SOAP. For instance, REST has read caching and
conditional GET, whereas SOAP does not.
8)
RESTful
Web Services are fast because there is no strict specification like SOAP. It
consumes less bandwidth and resource
Selection of web service for
application:
Choice to use SOAP or REST is dependent on a
number of factors including security, transactional, performance, development
and other application requirements. One is not clearly better than the other in
all situations. However, for most Web service applications, REST currently
seems to be the favorite except when specific SOAP features are absolutely
required.
SOAP is mostly preferred
in the applications which require higher security like banking and financial
application etc. whereas in other scenario most of the applications using REST.
No comments:
Post a Comment