Web services
What are web services?
If you are a developer or you have listened to one of us wax lyrically you may have heard of web services. You may not understand how they work or what they do though. Basically web services are a means for one application to talk to another, or a sort of Internet form of communication that allows different platforms - written in whatever language - the ability to converse and share information.
XML was written in part for this purpose and has freed us from the limitations of HTML, CSV files and proprietary formats. It is being used along with the SOAP and REST web service protocols to bring us things like 'Tweets', Amazon affiliate programs and a plethora of mash-ups.
In order for applications on the Internet to freely exchange information we need an open protocol that can be interpreted and implemented easily by many different systems. To achieve this we need an information exchange method that is widespread across multiple different systems; HTTP the underlying protocol of the humble web browser fits these criteria.
The Web has been using HTTP since it was born. It can be very secure using 128bit encryption over HTTPS, and has been tested thoroughly. HTTP also supports verbs / actions such as GET, POST, DELETE, and PUT, and it has locations or URIs. In short it is a perfect fit and is very flexible.
SOAP
SOAP stands for Simple Object Access Protocol and goes hand in hand with a WSDL which describes the web service and how to use it. It was primarily designed to exchange information unobtrusively between systems over the web. It does this pretty well and many code editors like Visual Studio have tools that let you get on with writing a web service very easily. The protocol understands things like primitive data types (whole numbers, natural numbers, strings, etc.) and object orientation and highly useful applications can be made with this. It became a W3C recommendation in 2003.
REST
REST is an acronym standing for Representational State Transfer. A man called Roy Fielding came up with this to describe the Web itself as an Architectural style of network. It is has no specification because it is basically some rules about how to achieve things. It lists some constraints and things to bear in mind while writing a web service.
- What are the resources or URIs?
- What is the format?
- What methods are supported at each URI?
- What status codes could be returned?
With this set of rules you can make a web service that will work in the same way that the world wide web works. Each resource can be uniquely described and acted upon as easily as writing a URL eg. http://www.mysite.com/employee.aspx?EmployeeID=5&Type=Retrieve. A REST web service should act like a really well made website but instead of using HTML it uses XML.
Web services, SOAP and REST it goes without saying all fall into the realm of geekery that are unlikely ever to require the average website owners attention. However hopefully the above gives just enough of an understanding to allow you to follow the developer next time they start waxing lyrically.
This blog post was written by Will
If you would like to discuss this post why not follow us on twitter?

