What is a Web Service?
This book assumes that you are familiar with the notion of using your computer (the client) to request that
some other computer (the server's) perform some task and respond over the Internet. The work a server
does is called a service. The service might be returning a weather forecast, or, in the case of Product
Advertising API, returning information about items for sale on Amazon. Some of these request and
response interactions over the Internet are considered web services provided by a web server.
A web service is any piece of software that uses REST and/or a standardized XML messaging system,
described by a WSDL (Web Service Definition Language) (pronounced "wiz-dal"), to exchange data
between applications or systems. A web service must have some simple mechanism for interested parties
to locate the service and its public interface using standard network protocols, such as, but not limited
to, SOAP over HTTP. Software applications written in various programming languages and running on
various platforms can use web services transparently to exchange data over computer networks, like the
Internet, because the WSDL serves as the definition of the language used by the computers.
In Product Advertising API:
• Requests and responses occur across the Internet
• Client and server use REST, SOAP, or XML as the means of communication
• Client and server agree on the grammar and syntax used in the requests and responses by specifying
a WSDL
• Requests and responses are not tied to a single operating system or programming language.
A simple example of a Product Advertising API request is one that uses the
ItemSearch
operation. This
request asks Amazon's web servers to find descriptions of items in its data bases. The web servers carry
out their service by finding the item descriptions and then sending those back to the requester.
All Product Advertising API requests are based on REST or SOAP and all of the responses are based
on XML.
Note
For more information about REST, see
Anatomy Of a REST Request (p. 46)
.
What is XML?
XML (Extensible Markup Language) is a standard defined by the World Wide Web Consortium (W3C).
XML uses tags (identifiers enclosed in brackets, for example, <para>) to label content in text documents.
These tags, collectively called the "markup," can be read by humans and computers. XML tags, like SGML
tags, encode not only the meaning of the content but also its structure.
XML looks like HTML but XML has nothing to do with the display of the content, which is the central focus
of HTML. The following XML tags label the content they enclose as a paragraph.
<para>This is a paragraph.</para>
The <para> tag has nothing to do with the display of the sentence. The tag, for example, does not take
attributes such as font, size, or style.
Unlike HTML, there is not a single set of tags used in all XML documents. XML enables designers to
create their own set of tags that are appropriate to their business. For example, Product Advertising API
encodes its APIs using an XML document called a WSDL. Other companies create their own XML tags
to define their APIs. The tags in these two WSDLs most likely would be completely different. The syntax
API Version 2011-08-01
12
Product Advertising API Developer Guide
What is a Web Service?