A URI used by an OData consumer has up to three significant parts, as follows:
A service root URI
A resource path
Query string options
An example of an OData URI is http://ebayodata.cloudapp.net/Items?search=mobile&$top=5&$skip=5
The components of this URI are then broken down as follows:
http://ebayodata.cloudapp.net
is the service root.
/Items
is the resource path.
search=phone&$top=3&$skip=5
are the query string options.
If you use Internet Explorer (IE) to navigate to this URI, you should see something like Figure 27.2. The page shows real eBay items for sale. The query retrieves three items—the sixth, seventh, and eighth items from a search result set—that match the phrase phone. This was done using the query string parameters search, $top
, and $skip
.
IE has a built-in feed reader, which is enabled by default. A quick way to view the XML result is to right-click the page and select View Source. This is a nuisance when developing, however, and you may prefer to disable the feed reader instead.
To disable the feed reader within IE, complete the following steps:
1. Select the Tools menu.
2. Select the Internet Options submenu.
3. Select the Content tab.
4. Click the Settings button of the Feed and Web Slices section to present the Feed Settings dialog.
5. Uncheck the Turn on Feed Reading View option.
6. Click OK, closing all dialog boxes.
After the feed reader has been switched off, the entire XML query result can be viewed with syntax highlighting, as shown in Figure 27.3.
The format of the XML is, in this case, an Atom feed. Some services are capable of supporting other formats, which can be specified using the $format query option.
18.220.9.237