Java Reference
In-Depth Information
The sample data used throughout this section comes from eBay. Like many companies, eBay
provides interfaces for developers to leverage in their own applications. As is also typical, the
data can be retrieved in either XML or JSON format.
The data retrieved is a list of the 20 best-selling items on eBay. A reduced sample of the XML
data looks like this:
<xml version="1.0" encoding="UTF-8"?>
<FindPopularItemsResponse xmlns="urn:ebay:apis:eBLBaseComponents"
xsi:schemaLocation="urn:ebay:apis:eBLBaseComponents docs/xsd/ebay.xsd">
...roughly 17 individual attributes for an item
... 19 other items in identical structure ...
The JSON data is similar (though it has no whitespace, which has been added here for readabil-
"Item":[{"ItemID":"140356481394", ... 17 individual attributes ... }],
... 19 other items in identical structure ...
Whichever representation is used, both greatly benefit from enabling compression as they are
transferred. In fact, once the data is compressed, the sizes are much closer: 3,471 bytes for
the compressed JSON data and 3,742 for the compressed XML file. That makes the size dif-
Search WWH ::

Custom Search