Introduction to Web Services

Leave a comment

Introduction

Web Services are defined as a machine to machine interaction that takes place over the world wide web. Applications and servers expose functionality and data that allows other machines to communicate with them, often through standards that have been agreed upon by organizations, corporations and the community.

Previously, there had been many attempts to allow different applications to be able to talk to each other, especially for business. DCOM, EDI, CORBA were all pieces of attempts to make machine to machine communication possible.

SOAP

With the worldwide web came http. There have been different standards that have run on top of this protocol, such as SOAP, or Simple Object Access Protocol. SOAP is operating system independent and is XML based. If a request is sent to a SOAP server, the server will be able to parse the message and send a response back, which can also be parsed. Each party can exist in a completely independent infrastructure and still be able to communicate programmatically over the www through firewalls. A SOAP message generally consists of a SOAP envelope, a header, a body and a fault. There are then extensible features such as security. With SOAP also came the WSDL, or Web Service Description Language, which described what web services were on offer, greatly helping the development process.

SOAP does have a couple of disadvantages, namely that the XML contains a large amount of information, which can mean larger files to transmit and a longer parsing time.

REST

REST, or REpresentational State Transfer, is another way applications can communicate. In theory it is a design concept for managing state information. RESTful web services use specific URLs. E.g. http://website.com/items/ could represent a list of items. http://website.com/items/101/ could represent a particular item.

REST methods for CRUD are achieved through HTTP verbs:

  • GET – retrieve
  • POST – update
  • PUT – create
  • DELETE – delete

REST is advantageous in that it is fast and simple.

 

FORMATS

As mentioned, SOAP uses XML as it’s format choice. The output of REST can be XML, JSON, CSV, RSS etc, which can make it easier for a consuming application to parse.

JSON, or JavaScript Object Notation, is an open standard format that consists of attribute-value pairs. E.g.

{

“name”: “Bob”,

“address”: {
“street”: “1 Times Sq”,
“city”: “New York”
}

}

 

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − five =