Previous Page Arrow Next Page Arrow

3.7 Typical Feed Entry

The feed is then followed by a list of entries.

The service consumer can also read the entries one by one. For example the first entry of our example feed can be read with the following HTTP request:

GET /sdata/myApp/myContract/-/salesOrders('43660')

This request returns an entry like:

<entry xmlns:sdata="http://schemas.sage.com/sdata/2008/1" 
       xmlns:http="http://schemas.sage.com/sdata/http/2008/1" 
       xmlns="http://www.w3.org/2005/Atom" >
  <id>http://www.example.com/sdata/myApp/myContract/-/salesOrders('43660')</id> 
  <title>Sales Order 43660</title>
  <updated>2008-03-31T13:46:45Z</updated>
  <link rel="self" type="application/atom+xml; type=entry" title="Refresh" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders('43660')" />
  <link rel="edit" type="application/atom+xml; type=entry" title="Edit" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders('43660')" />
  <link rel="http://schemas.sage.com/sdata/link-relations/schema" 
        type="application/xml" title="Schema" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders/$schema?version=5" />
  <link rel="http://schemas.sage.com/sdata/link-relations/template" 
        type="application/atom+xml; type=entry" title="Template" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders/$template" />
  <link rel="http://schemas.sage.com/sdata/link-relations/post" 
        type="application/atom+xml; type=entry" title="Post" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders" />
  <link rel="http://schemas.sage.com/sdata/link-relations/service" 
        type="application/atom+xml; type=feed" title="Service" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders/$service" />
  <category scheme="http://schemas.sage.com/sdata/categories" 
            term="resource" label="Resource"/>
  <content>Sales order 43660: amount 1553,1035</content>
  <sdata:payload>
    <salesOrder sdata:key="43660" xmlns="http://schemas.sage.com/myContract">
      <orderDate>2001-07-01</orderDate>
      <shipDate xsi:nil="true" />
      <contact sdata:key="216" 
               sdata:url="http://www.example.com/sdata/myApp/myContract/-/contacts('216')" 
               sdata:lookup="http://www.example.com/sdata/myApp/myContract/-/contacts"/>
      <orderLines sdata:url="http://www.example.com/sdata/myApp/myContract/-/salesOrderLines?where=salesOrderID%20eq%2043660"/>
      <subTotal>1553.1035</subTotal>
    </salesOrder>
  </sdata:payload>
  <http:etag>gJaGtgHyuAwW6jMI4i0njA==</http:etag>
</entry>

The elements are described in the table below:

Element Description Compliance
id Resource URL. MUST
title A friendly title for the resource (localized). MUST
updated The time the contents of the feed was last modified. Otherwise the time the entry was produced. MUST
link rel=”self” Resource URL - same as id. MUST
link rel=”edit” URL where changes to this resource should be submitted - normally, same as “self”. MAY
link rel= "http://.../link-relations/schema" Schema describing the resource structure. This link is absent when the entry is inside a feed because the link already exists at feed level. MUST
link rel= "http://.../link-relations/template" Template resource URL. This link is absent when the entry is inside a feed because the link already exists at feed level. MUST (if POST allowed)
link rel= "http://.../link-relations/post" URL to POST resource creation requests. See Create Operation section. This link is absent when the entry is inside a feed because the link already exists at feed level. MUST (if POST allowed)
link rel="http://.../link-relations/service" Intermediate URL that lists service operations. See Intermediate URLs section. This link is absent when the entry is inside a feed because the link already exists at feed level. MAY
link rel="http://.../link-relations/queries" Intermediate URL that lists named queries. See Intermediate URLs section. This link is absent when the entry is inside a feed because the link already exists at feed level. MAY
category scheme="http://.../sdata/categories" Category in the SData scheme. The term attribute must be set to resource as the entry describes a resource. See SData Scheme section for details. A provider can add other <category> elements to the entry but the entry should not have more than one category in the SData scheme. SHOULD
content Description of the resource. The service provider is free to decide what goes into the contents but it must be possible for people to read the contents. SHOULD
sdata:payload XML payload. The structure of this XML payload must conform to the schema returned by the schema URL. MUST
http:etag Value that identifies the state of the resource on the provider side. This value is used by the service provider to detect concurrent modifications. It can also be used for caching. MAY (MUST if supportsETag is true)

Previous Page Arrow Next Page Arrow