Java Reference
In-Depth Information
SAMPLE DATA PAYLOADS
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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ebay:apis:eBLBaseComponents docs/xsd/ebay.xsd">
<Timestamp>2013-03-29T01:57:46.530Z</Timestamp>
<Ack>Success</Ack>
<Build>E815_CORE_APILW2_15855352_R1</Build>
<Version>815</Version>
<ItemArray>
<Item>
<ItemID>140356481394</ItemID>
...roughly 17 individual attributes for an item
</Item>
... 19 other items in identical structure ...
</ItemArray>
</FindPopularItemsResponse>
The JSON data is similar (though it has no whitespace, which has been added here for readabil-
ity):
{"Timestamp":"2013-03-29T02:17:14.898Z",
"Ack":"Success",
"Build":"E815_CORE_APILW2_15855352_R1",
"Version":"815",
"ItemArray":{
"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