Web Services - Implementation of Web Services

There are various ways of implementation of the web services.

Remote Procedure Call:

The earliest implementation of web service are called remote procedure call (RPC) these API's are implemented using existing languages like C. Later W3C standards has been established for XML based RPC called as XML-RPC. Basically in RPC client calls remote function and parameters being passed and returned in predefined order.

SOAP web service:

SOAP stands for Simple Object Access Protocol is used for structured approach rather than calling the remote function and expecting returns this client server communicate with the messages(SOAP Packets). This approach gives loosely coupled interface and less tied with the particular language. SOAP implementation is very easy as it has got named parameters rather than passing parameters in the particular order, this will lead SOAP web services easier to debug and read. To use SOAP web service you need to know three things URL of the web service, method exposed and names and data types of message parameters which needs to be passed to the method. WSDL stands for "Web Service Description Language" is often used along with SOAP to access the web service. WSDL is XML document that describes remote services available including list of available operation, parameters and data types. The client application will use SOAP to call method listed in the WSDL.

HTTP (REST) Web Services:

REST stands for "Representable State Transfer" a representation which is being returned which places client application in state and because of the traversal to the another link a new representation, so the client transfers state with each representation. REST is not standard it is an architectural style so we dont see any W3C standard defined for the REST. The REST captures chractristics of web. It uses following standers HTTP, URL, XML/HTML/JPG/PNG etc (Resource Representation) and text/xml, text/html, image/gif, image/jpeg, etc (MIME Types). Client can use the HTTP request like GET,POST,DELETE to call this web service and the web service can return the HTTP response as XML,HTML, JPG, PNG etc

JSON Web Services:

JSON stands for "Javascript Object Notation" is the lightweight data interchange format. The basic difference between JSON and XML is XML is document oriented and JSON is data oriented so JSON is more suitable for the lightweight data transfer. JSON is suited with the AJAX for the better performance. JSON is subset of object literal notation of the JavaScript. We can have web service with returned JSON data format.

Web Services - Learn the XML

XML stands for "Extensible Markup Language" which is designed to transport and store the data. Following are some of main advantages of XML because of which XML fit for using in the Web Service data transport

Advantages Of XML:
  • The First Benefit of XML is because we are writing you own markup there is no limited set of tags and user can choose appropriate names for the tags.
  • As it is text based it is platform independent.
  • Using XML anybody can design tags and have specific schema imposed on the XML to follow specific tags. In a way anybody can define the stranded for the XML.
Primary advantages of the XML for Web services that it allows programs written in different languages on different platforms to communicate with each other in a standards-based way. SOAP stands for "Simple Object Access Protocol" is the protocol which is written completely using the XML because of the above advantages, which is used in the communication using web services.

Simple Object Access Protocol:
SOAP once stood for "Simple Object Access Protocol", sometimes gets confused with Service Oriented Architecture (SOA) protocol which is not true.SOAP is rely on the XML and SOAP envelope consists of SOAP header and SOAP body which is used for communicating with the web services.
Following is the example of the SOAP envelope