4.2.1.7 Retrieve a Collection of Entities with Named Resource Streams by Using the AtomPub Format
The following example illustrates the exchange of messages that is required for a client to retrieve a collection of Photo entities, each with two named resource streams (Thumbnail and PrintReady), by using the AtomPub format. This example is supported only in the OData 3.0 protocol.
Request:
-
GET /service.svc/Photos HTTP/1.1 Host: host Accept: application/atom+xml DataServiceVersion: 3.0 MaxDataServiceVersion: 3.0
Response:
-
HTTP/1.1 200 OK Date: Fri, 12 Dec 2008 17:17:11 GMT Content-Type: application/atom+xml;type=feed Content-Length: nnn DataServiceVersion: 3.0 <feed xml:base="http://host/service.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <title type="text">Photos</title> <id>http://host/service.svc/Photos</id> <updated>2008-03-30T21:52:46Z</updated> <link rel="self" title="Photos" href="Photos/SampleModel.Photo" /> <entry> <category term="SampleModel.Photo" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> <id>http://host/service.svc/Photos(1)</id> <title type="text" /> <updated>2008-03-30T21:52:45Z</updated> <author> <name /> </author> <link rel="edit" title="Photos" href="Photos(1)/SampleModel.Photo " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/mediaresource/Thumbnail" type="image/png" title="Thumbnail" href="Photos(1)/SampleModel.Photo/Thumbnail " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Thumbnail" type="image/png" title="Thumbnail" href="Photos(1)/SampleModel.Photo/Thumbnail " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/mediaresource/PrintReady" type="image/png" title="PrintReady" href="Photos(1)/SampleModel.Photo/PrintReady " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/PrintReady" type="image/png" title="PrintReady" href="Photos(1)/SampleModel.Photo/PrintReady " /> <content type="application/xml"> <m:properties> <d:ID m:type="Edm.Int32">1</d:ID> <d:Name m:type="Edm.String">Mount Fuji</d:Name> </m:properties> </content> </entry> <entry> <category term="SampleModel.Photo" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> <id>http://host/service.svc/Photos(2)</id> <title type="text" /> <updated>2008-03-30T21:52:45Z</updated> <author> <name /> </author> <link rel="edit" title="Photos" href="Photos(2)/SampleModel.Photo" /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/mediaresource/Thumbnail" type="image/png" title="Thumbnail" href="Photos(2)/SampleModel.Photo/Thumbnail " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Thumbnail" type="image/png" title="Thumbnail" href="Photos(2)/SampleModel.Photo/Thumbnail " m:etag="######" /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/mediaresource/PrintReady" type="image/png" title="PrintReady" href="Photos(2)/SampleModel.Photo/PrintReady " /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/PrintReady" type="image/png" title="PrintReady" href="Photos(2)/SampleModel.Photo/PrintReady " m:etag="######" /> <content type="application/xml"> <m:properties> <d:ID m:type="Edm.Int32">2</d:ID> <d:Name m:type="Edm.String">Mount Rainier</d:Name> </m:properties> </content> </entry> </feed>