(.*)\<\/title\>/si', file_get_contents(__FILE__), $result); $pageTitle = trim($result[1]); $pageURL = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>

JavaScript Object Notation (JSON) uses name/value pairs. This is similar to the tags used by XML. An example from the figure below shows, at the left, the XML tag of "<state>" with the value of "MN." The pairs for JSON are at the right. It similarly shows the name "state" is paired with the value "MN." The name/value pairs do not need to be in a specific order. Also, like XML, JSON provides resiliance to changes and avoids the brittleness of fixed record formats. See XML Tagged Format Compared to Fixed Record Formats. This applies to JSON as well.

JSON and XML Comparison

JSON is an alternative to SOAP and Representational State Transfer (REST).

JSON and Web Services

The following figure illustrates using JSON for Web Services. Also see Web Services Explained.

JSON Messages

Related Articles

More on the general topic: Messaging Specifications

Related Online Briefings

You may use this material for your work or classes. Reprint Policy. Be sure to check the menu at the left for other articles available on this site.

The Savvy Manager's Guide

Douglas K Barry is also the author of a book that explains Web Services, service-oriented architecture, and Cloud Computing in an easy-to-understand, non-technical manner.

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide (Second Edition)

by with David Dick

This is a guide for the savvy manager who wants to capitalize on the wave of change that is occurring with Web Services, service-oriented architecture, and—more recently—Cloud Computing. The changes wrought by these technologies will require both a basic grasp of the technologies and an effective way to deal with how these changes will affect the people who build and use the systems in our organizations. This book covers both issues. Managers at all levels of all organizations must be aware of both the changes that we are now seeing and ways to deal with issues created by those changes.