Wednesday, 27 July 2016

Webservice



What is a web service?

In simple word web services is a collection of standards or protocols for exchanging information between two devices or applications. Web service is language independent way of communication. We just look bellow figure to more clear our concept.
web services
In above figure you can see java can communicate to other languages like .net, PHP and vice versa by using web services i.e. web services has no language limitation.
Types of 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 is a W3C recommendation for communication between two applications.
It is platform independent and language independent. By using SOAP, you will be able to interact with other programming language applications.
Advantages of Soap Web Services
WS Security: SOAP defines its own security known as WS Security.
Language and Platform independent: SOAP web services can be written in any programming language and executed in any platform.


Disadvantages of Soap Web Services
Slow: SOAP uses XML format that must be parsed to be read. It defines many standards that must be followed while developing the SOAP applications. So it is slow and consumes more bandwidth and resource.
WSDL dependent: SOAP uses WSDL and doesn't have any other mechanism to discover the service.
Web Service Components
  1. SOAP
  2. WSDL
  3. UDDI
SOAP: SOAP is an acronym for Simple Object Access Protocol.
WSDL: WSDL is an acronym for Web Services Description Language. WSDL is pronounced as wiz-dull.
WSDL is a xml document containing information about web services such as method name, method parameter and how to access it.
WSDL is a part of UDDI. It acts as a interface between web service applications.
UDDI: UDDI is an acronym for Universal Description, Discovery and Integration.
UDDI is a XML based framework for describing, discovering and integrating web services.
UDDI is a directory of web service interfaces described by WSDL, containing information about web services.

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.
Can use SOAP: RESTful web services can use SOAP web services as the implementation.
Permits different data format: RESTful web service permits different data format such as Plain Text, HTML, XML and JSON