Pre-lab 1.3

In the next lab, we will explore how to interact with the web. Web service is quite an old terminology  used to describe something like web function calls; however, the exact definition have been a bit blurry. The W3C defines a “Web service” as “a software system designed to support interoperable machine-to-machine interaction over a network“. It has an interface described in a machine-processable format (specifically Web Services Description Language, known by the acronym WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards”.

Lets describe what W3C says in human words. W3C uses a lot of different standards stacked on-top of each other in order to enable a developer (or machine) to call a fully typed function. We mean by fully type function that every parameter and return has a pre-described type such as string, integer, boolean and even user defined structures. This requires a lot of different standards such as SOAP, WSDL to achieve this goal and it has a lot of overhead since we use many headers inside an HTTP packet. After the rise of JavaScript in the web and well adaptation of what is so called AJAX (simply using javascript inside HTML for asynchronous server calls), many people start to love programming without complicated types, including me, simply because, its easier and faster to write a code.

Personally I believe that since HTTP protocol is quite simple, we shall use a simple way to retrieve resources from the web using just POST, GET and DELETE HTTP requests. The response to people like me is what is so called Web API (or  REST-style web services) which is considered a replacement of SOAP web-services.

Please read this article before the next lab.

RESTful Web services: The basics

In the next lab, we will learn how to use web services or in other words, how to consume  contents from the web. In AWS lab series, we will learn how to build our own RESTful web server that provides content to clients (such as android devices).

Note: For scientific purposes we should mention that RESTful web-services  have actually some drawbacks over traditional SOAP, one of the most is  caching issues. If the server provides timely data, then the client may not get the latest result, because of intermediate proxy servers which may cache some old data.  This issue should be solved using some tricks (adding some options in HTTP request to prevent caching). It is also important to note that since SOAP style web-service is fully typed, its more robust and less prone to run time errors.

References