What are Web Services and Where are They used?
Web Services are the means by which devices communicate over the World Wide Web. Whether you use a mobile application, search engine or an enterprise system, the user piece of the application (the interface) resides on your device. The data, and potentially the business rules, live on some other server on the network. How your interface communicates with the server piece is the role of Web Services.
The official definition of a Web Service is “a software system designed to support interoperable machine-to-machine interaction over a network.” Breaking this down, the communication between servers requires an agreed-to (i.e., interoperable) format and structure: I need to understand what you want, and you need to understand what I send you.
For most systems, these specifications are defined in the system’s Web Service Description Language, or WSDL. A WSDL defines how incoming information, such as queries, need to be structured for the service application to make sense of it, and how outgoing data will be structured so that the requesting application can understand it. These definitions are stored as XML (Extensible Markup Language) specifications. A common structure for WSDL information is the Simple Object Access Protocol (SOAP) that allows communication interfaces to be developed without having to rebuild low-level protocol specifications.
Having defined protocol and data structure between servers in place, the next level of Web Service is the choice regarding “state:” how much of the current interaction depends on previous interactions? As an example, when you go to a deli for lunch, there is a typical exchange regarding type of sandwich, kind of bread, list of condiments, eat-in or take-out, that takes place. With each exchange, folks remember the current “state” of the lunch being asked for and each exchange provides increasing information about your lunch.
The same can be true in a Web Service exchange; every interaction can build on the previous one selected, for example, world region, type of map and type of imagery. This type of Web Service exchange is frequently used where there is inconsistent information available, or where the user needs to drive selection criteria to return precise information. The downside of using state-model Web Services is due to the overhead associated with “remembering” the state on the server. Implementation of this memory is done either with cookies or by using dedicated connections between the client and the server to ensure the client is always communicating with the same server. The former solution is unreliable – some agencies disallow cookies, they can become corrupted or they can be used to track communication patterns – while the latter ties up valuable server resources and ultimately prevents server scaling.
As a result, the Web Service model of choice is stateless: every information exchange is independent of prior ones, and is complete. In our deli example, this is akin to your lunch slip being received by the short order cook. Likewise, between computers, sending all the request information in a single message allows the server application to execute and return the needed information without remembering any previous communications. These exchanges can be executed using WSDL and SOAP, or by using the most recent architectural process: Representational State Transfer (REST).
The REST model is an extension of how the World Wide Web itself works. First, a request is made for a site via a URL call and the site is returned to the browser. Using the same HTML GET, POST and PUT requests, a RESTful Web Service returns the requested information using HTML or XML. This allows developers to put Web Service calls directly into web sites with no interface development to interpret the returning data. This is the theory behind mashup site development.
Web Services have become the silent but critical backbone to our modern device-driven world. The common protocols, interfaces and communication standards that have evolved over the last 15 years allow us to develop mobile, tablet and PC-based applications that can order lunch, return stock prices or find the perfect gift rapidly, reliably and securely.