OData supports two formats for representing the resources (Collections, Entries, Links, etc) it exposes: the XML-based Atom format and the JSON format. This document describes how OData resources are represented in Atom (plus additional elements defined in AtomPub) and [OData-JSON] describes the JSON representation. The content type negotiation section of the [OData-Operations] document describes how clients can use standard HTTP content type negotiation to tell an OData service which format it wants to use.
As described in Atom [RFC4287], Atom is an XML-based document format that describes Collections of related information known as "feeds". Feeds are composed of a number of items, known as Entries. AtomPub [RFC5023] defines additional format constructs for Entries and Feeds to enable the resources they represent to be easily categorized, grouped, edited and discovered. For the remainder of this document, the term Atom is used to represent the combination of the format/representation rules defined in Atom[RFC4287] and AtomPub [RF5023].
As noted in the OData Basics section of [OData:Core], OData services expose Collections of structured Entries, making Atom a natural fit for representing OData resources. Since Atom does not define how structured data is encoded with feeds, to enable transfers of structured content by OData services, this document defines a set of conventions for representing structured data in an Atom feed.
It should be noted that feeds following the conventions defined in this document are valid AtomPub feeds and can be consumed by feed readers, tools, etc. which are only aware of the Atom standards ([RFC4287] & [RFC5023]), but not the additional conventions defined in this document.
The following sections define how resources (Collection, Entries, etc) exposed by an OData service can be represented in requests and responses payloads using the Atom format. For details regarding how to create various request types (Retrieve, Create, etc) see [OData-Operations] .
Through out this section the notation
Values of OData primitive types are represented as values of XML elements/attributes as per the table below. Note: The type system used by OData services is described in full in the primitive types section of the [OData-Core] document. In addition to the rules stated in the table, if the value of a primitive type is null, then it is represented as an empty XML element with an m:null="true" attribute ("m" identifies the OData metadata namespace).
| Primitive Type | Serialization Format in XML Documents |
|---|---|
| Edm.Binary | Base64 encoded value of an EDM.Binary value. See [RFC3548] . |
| Edm.Boolean | true | false |
| Edm.Byte | Same as the literal form in [OData:Core], except without the surrounding |
| Edm.DateTime | Same as the literal form in [OData:Core], except without the surrounding datetime'' syntax |
| Edm.Decimal | Same as the literal form in [OData:Core], except without the trailing "m" |
| Edm.Double | Same as the literal form in [OData:Core] |
| Edm.Guid | Same as the literal form in [OData:Core], except without the surrounding guid'' syntax |
| Edm.Int16 | Same as the literal form in [OData:Core] |
| Edm.Int32 | Same as the literal form in [OData:Core] |
| Edm.Int64 | Same as the literal form in [OData:Core] |
| Edm.SByte | Same as the literal form in [OData:Core] |
| Edm.Single | Same as the literal form in [OData:Core], except without the trailing "f" |
| Edm.String | Same as the literal form in [OData:Core], except without surrounding double quotes |
| Edm.Time | Same as the literal form in [OData:Core], except without the surrounding time'' syntax |
| Edm.DateTimeOffset | Same as the literal form in [OData:Core], except without the surrounding datetimeoffset'' syntax |
As described in [OData-Core], if a service exposes several Collections, then to aid discovery of those Collections by clients it is useful for the service to expose a Service Document which lists the available Collections. Service Documents are described in AtomPub [RFC5023], section 15.
For example, the URI http://services.odata.org/OData/OData.svc identifies the Service Document of a sample OData service which exposes a Categories, Products and Suppliers Collection. For convenience, a sample Service Document is shown in the listing below.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<service xml:base="http://services.odata.org/OData/OData.svc/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Products">
<atom:title>Products</atom:title>
</collection>
<collection href="Categories">
<atom:title>Categories</atom:title>
</collection>
<collection href="Suppliers">
<atom:title>Suppliers</atom:title>
</collection>
</workspace>
</service>Collections represent a set of Entries. In OData, Collections are represented as Atom feeds ([RFC5023] ), with one Atom entry for each Entry within the Collection. For example, a Collection of product category Entries (that could be part of a product catalog) exposed by an OData service, as identified by the URI http://services.odata.org/OData/OData.svc/Categories, is represented as shown below. The format of
Note: The "m" and "d" prefixes represent the OData metadata and data namespaces. It is likely the next version of OData will generalize the namespace URI to use an odata.org based URI.
OData V1:<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base=http://services.odata.org/OData/OData.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">Categories</title>
<id>http://services.odata.org/OData/OData.svc/Categories</id>
<updated>2010-03-10T08:38:14Z</updated>
<link rel="self" title="Categories" href="Categories" />
<entry>
<id>http://services.odata.org/OData/OData.svc/Categories(0)</id>
<title type="text">Food</title>
<updated>2010-03-10T08:38:14Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Category" href="Categories(0)" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=feed"
title="Products" href="Categories(0)/Products" />
<category term="ODataDemo.Category"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:Name>Food</d:Name>
</m:properties>
</content>
</entry>
<!-- <entry> elements representing additional Categories go here -->
</feed>In response payloads only, OData v2 supports two pieces of collection-level metadata: an Entry count (the total count of the number of entities in the Collection) and "next links" in the case when a partial listing of the Collection of Entries is being represented.
The Entry count, is only included in the feed returned by an OData service when the request URI includes the $inlinecount System Query Option. In this case, the count information is represented as a
In response payloads only, if the server does not include an
<feed xml:base="http://services.odata.org/Northwind/Northwind.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">Customers</title>
<id>http://services.odata.org/Northwind/Northwind.svc/Customers</id>
<updated>2010-03-10T09:34:11Z</updated>
<link rel="self" title="Customers" href="Customers" />
<strong><m:count>91</m:count></strong>
<entry>
<id>http://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')</id>
<title type="text" />
<updated>2010-03-10T09:34:11Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Customer" href="Customers('ALFKI')" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders"
type="application/atom+xml;type=feed"
title="Orders" href="Customers('ALFKI')/Orders" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CustomerDemographics"
type="application/atom+xml;type=feed"
title="CustomerDemographics" href="Customers('ALFKI')/CustomerDemographics" />
<category term="NorthwindModel.Customer"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:CustomerID>ALFKI</d:CustomerID>
<d:CompanyName>Alfreds Futterkiste</d:CompanyName>
<d:ContactName>Maria Anders</d:ContactName>
<d:ContactTitle>Sales Representative</d:ContactTitle>
<d:Address>Obere Str. 57</d:Address>
<d:City>Berlin</d:City>
<d:Region m:null="true" />
<d:PostalCode>12209</d:PostalCode>
<d:Country>Germany</d:Country>
<d:Phone>030-0074321</d:Phone>
<d:Fax>030-0076545</d:Fax>
</m:properties>
</content>
</entry>
<!-- <entry> elements representing additional customers goes here -->
<strong><link rel="next"
href="http://services.odata.org/Northwind/Northwind.svc/Customers?
$inlinecount=allpages&$skiptoken='ERNSH'" /> </strong>
</feed>In OData, Entries are represented as Atom
If the Entry being represented links to other Entries via Navigation Properties (e.g. a Product is related to a Category), then the Links are represented as
Metadata describing the Entry being represented can be specified using additional Atom-defined and OData-defined elements/attributes as defined by the following list.
m:etag attribute
For example, as shown in the following listing, the Category Entry identified by the URI http://services.odata.org/OData/OData.svc/Categories(0), has two primitive properties (ID & Name) and one Navigation Property named “Productsâ€, which identifies a feed of Product Entries related to the Category.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<entry xml:base="http://services.odata.org/OData/OData.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">
<id>http://services.odata.org/OData/OData.svc/Categories(0)</id>
<title type="text">Food</title>
<updated>2010-03-10T10:43:51Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Category" href="Categories(0)" />
<strong><link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=feed" title="Products"
href="Categories(0)/Products" /></strong>
<category term="ODataDemo.Category"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<strong><content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:Name>Food</d:Name>
</m:properties>
</content></strong>
</entry>To conserve resources (bandwidth, CPU, and so on), it is generally not a good idea for an OData service to return the full graph of Entries related to the Entry (or Collection of entries) identified in a request URI. For example, an OData service should defer sending related Entries unless the client explicitly asked for them using the $expand System Query Option which provides a way for a client to state related entities should be represented inline.
As shown in the example in the prior section, by default properties which represent Links (the "Products" property in the example) are represented as a element to indicate the service deferred representing the related Entries. If needed, a client can then use the URI in the href attribute in a subsequent retrieve request to obtain the related Entries.
As described in the $expand System Query Option section of the [OData-URI] document, a request URI may include the $expand query option to explicitly request that a linked to Entry or collection of Entries be serialized inline, rather than deferred.
In this case the related Entry or collection of Entries is represented as the child element of an
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base=http://services.odata.org/OData/OData.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">
<id>http://services.odata.org/OData/OData.svc/Categories(0)</id>
<title type="text">Food</title>
<updated>2010-03-11T06:40:04Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Category" href="Categories(0)" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=feed"
title="Products" href="Categories(0)/Products">
<strong><m:inline></strong>
<feed>
<title type="text">Products</title>
<id>http://services.odata.org/OData/OData.svc/Categories(0)/Products</id>
<updated>2010-03-11T06:40:04Z</updated>
<link rel="self" title="Products" href="Categories(0)/Products" />
<entry>
<id>http://services.odata.org/OData/OData.svc/Products(0)</id>
<title type="text">Bread</title>
<summary type="text">Whole grain bread</summary>
<updated>2010-03-11T06:40:04Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Product" href="Products(0)" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
type="application/atom+xml;type=entry"
title="Category" href="Products(0)/Category" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier"
type="application/atom+xml;type=entry"
title="Supplier" href="Products(0)/Supplier" />
<category term="ODataDemo.Product"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:ReleaseDate m:type="Edm.DateTime">1992-01-01T00:00:00</d:ReleaseDate>
<d:DiscontinuedDate m:type="Edm.DateTime" m:null="true" />
<d:Rating m:type="Edm.Int32">4</d:Rating>
<d:Price m:type="Edm.Decimal">2.5</d:Price>
</m:properties>
</content>
</entry>
</feed>
<strong></m:inline></strong>
</link>
<category term="ODataDemo.Category"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:Name>Food</d:Name>
</m:properties>
</content>
</entry>Media Link Entries (MLE) are represented in the same way as regular Entries as described in Representing Entries; however, they also contain additional metadata per Entry that describes the Media Resource (MR) associated with the Entry and the
This additional MR-specific metadata is represented by the following constructs in the
Services may wish to have more flexibility over how Entries are represented within an
In general a service may choose to deviate from the conventions defined in Representing Entries section above and represent the value of a Property of an Entry as the value of a standard Atom element (Title, Summary, etc) or as the value of an element in a custom namespace. When a service does this form of customization it breaks the shared assumption between client and server regarding how Entries are encoded within an
The following table lists all the Feed Customization annotations defined in OData.
For example, the sample Service Metadata Document at http://services.odata.org/OData/OData.svc/$metadata states the Name Property of the Category Entry is represented as the value of the
<strong>Snippet from Service Metadata Document</strong>
<EntityType Name="Category">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
<Property Name="Name" Type="Edm.String"
Nullable="true"
<strong>m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text"
m:FC_KeepInContent="true"</strong> />
<NavigationProperty Name="Products"
Relationship="ODataDemo.Product_Category_Category_Products"
FromRole="Category_Products" ToRole="Product_Category" />
</EntityType>
<strong>Category representation in Atom</strong>
(see http://services.odata.org/OData/OData.svc/Categories(0) )
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://services.odata.org/(S(S_ODATA_RO))/OData/OData.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">
<id>http://services.odata.org/(S(S_ODATA_RO))/OData/OData.svc/Categories(0)</id>
<strong><title type="text">Food</title></strong>
<updated>2010-03-11T22:28:51Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Category" href="Categories(0)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=feed"
title="Products"
href="Categories(0)/Products" />
<category term="ODataDemo.Category"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<strong><d:Name>Food</d:Name></strong>
</m:properties>
</content>
</entry>If the Category Entry in the example above was part of a type hierarchy and the Name property was defined on the type Category derives from, then the mapping from Name to
<EntityType Name="Category" <strong>m:FC_TargetPath="SyndicationTitle" m:FC_SourcePath="Name"
m:FC_ContentKind="text" m:FC_KeepInContent="true"</strong>
BaseType:"Sample.BaseCategory">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
<NavigationProperty Name="Products"
Relationship="ODataDemo.Product_Category_Category_Products"
FromRole="Category_Products" ToRole="Product_Category" />
</EntityType>Instead of mapping the Name property to an Atom-defined element, a Property may be mapped to a custom element in any namespace. For example, the following listing maps the Street Property of the Address Complex Type on a Supplier entry to a custom
Snippet from Service Metadata Document
<EntityType Name="Supplier">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
<Property Name="Name" Type="Edm.String" Nullable="true"/>
<Property Name="Address" Type="ODataDemo.Address" Nullable="false"
<strong>m:FC_TargetPath="Road" m:FC_SourcePath="Street" m:FC_KeepInContent="true"
m:FC_NsUri="http://customUri" m:FC_NsPrefix="c"/></strong>
<Property Name="Concurrency" Type="Edm.Int32" Nullable="false" ConcurrencyMode="Fixed" />
<NavigationProperty Name="Products"
Relationship="ODataDemo.Product_Supplier_Supplier_Products"
FromRole="Supplier_Products"
ToRole="Product_Supplier" />
</EntityType>
<ComplexType Name="Address">
<Property Name="Street" Type="Edm.String" Nullable="true" />
<Property Name="City" Type="Edm.String" Nullable="true" />
<Property Name="State" Type="Edm.String" Nullable="true" />
<Property Name="ZipCode" Type="Edm.String" Nullable="true" />
<Property Name="Country" Type="Edm.String" Nullable="true" />
</ComplexType>
Supplier representation in Atom
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://services.odata.org/(S(S_ODATA_RO))/OData/OData.svc/"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
m:etag="W/"0"" xmlns="http://www.w3.org/2005/Atom" Xmlns:c="http://customUri">
<id>http://services.odata.org/(S(S_ODATA_RO))/OData/OData.svc/Suppliers(0)</id>
<title type="text">Exotic Liquids</title>
<updated>2010-03-11T22:47:21Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Supplier" href="Suppliers(0)" />
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=feed" title="Products"
href="Suppliers(0)/Products" />
<category term="ODataDemo.Supplier"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<strong><c:Road>NE 228th</c:Road></strong>
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:Name>Exotic Liquids</d:Name>
<d:Concurrency m:type="Edm.Int32">0</d:Concurrency>
<d:Address m:type="ODataDemo.Address">
<d:Street>NE 228th</d:Street>
<d:City>Sammamish</d:City>
<d:State>WA</d:State>
<d:ZipCode>98074</d:ZipCode>
<d:Country>USA</d:Country>
</d:Address>
</m:properties>
</content>
</entry>When represented in a request/response payload as part of an Entry, Complex Type or a standalone construct in a request payload, primitive properties are represented in Atom as child elements of an
See section 3.1 for the format of Properties when they are represented independently from their defining Entry (i.e. outside the context of the defining Entry).
When represented as a property of an Entry or Complex Type (also within an Entry) in a request/response payload, a property whose type is a complex type is represented as an XML element with each property of the complex type represented as a direct child element (as described in the prior section for primitive properties). For example, the Address Complex Type of a Supplier Entry is shown in the example below.
See section 3.1.2 for the format of Complex Type Properties when they are represented independently from their defining Entry (i.e. outside the context of the defining Entry).
The smallest unit of information that can be represented in Atom is an Entry. In several application scenarios it is practical to be able to identify a specific piece of information within the Entry, particularly when the entry is mapped to an application-level construct on the server. For example, a Presentation Entry may have a Property that is the abstract describing the presentation.
To enable this scenario, as described in the Resource Path section in the [OData-URI] document, OData supports directly addressing a Property of an Entry. Since there is not a natural mapping of a single Property (outside of the context of the defining Entry) to an Atom representation, OData represents the constituent parts of an Entry using a simple XML representation, which is described by the following subsections.
As described in the Resource Path section in the [OData-URI] document, OData supports directly addressing a Property of an Entry. The following subsections describe how each type of Property is represented in XML.
When a primitive Property is represented as a standalone construct in a response from an OData service (such as when a retrieve request is made to a URI that identifies a single Property) it is represented as a single XML element where the element name equals the name of the Property and the value of the element is the value Property value. For example, the response payload to a retrieve request that identifies the Name property of a Category Entry is represented as shown below.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Name xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">Bread</Name>When a Property whose type is a complex type is represented as a standalone construct, such as when a retrieve request is made to a URI that identifies a single Property, it uses a single XML element with the name of the Property and child elements for each Property defined on the complex type (formatted as per this section of the prior “Representing Primitive Properties†section). For example, the response payload to a retrieve request that identifies the Name property of a Category Entry is represented as shown below.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Address p1:type="ODataDemo.Address"
xmlns:p1="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
<Street>NE 228th</Street>
<City>Sammamish</City>
<State>WA</State>
<ZipCode>98074</ZipCode>
<Country>USA</Country>
</Address>OData services may support addressing the entry value of a primitive Property (see the description of the $value URI segment). In this case, the value is returned using the format (aka mime type) the OData service deems to be the entry format for the Property. For example, the HTTP response from the sample OData service when retrieving the Name string Property of a Category Entry is shown in the example below.
HTTP/1.1 200 OK
DataServiceVersion: 1.0;
Content-Type: text/plain;charset=utf-8
FoodA Link (or collection of Links) represents an associated Entry (or collection of associated Entries). As described in [OData-Operations] Links can be retrieved and modified to change the associations between Entries. A single link is represented as a
Note: in the paragraph above, "d" represents the OData Data Namespace.
For example, a link with multiplicity 1 (ex. Product is related to a single Supplier) would be represented in XML in a response as:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<uri xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
http://services.odata.org/OData/OData.svc/Suppliers(1)
</uri>For example, a link with multiplicity greater than 1 (e.g. Supplier is related to many products) would be represented in a response as:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<links xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
<uri>http://services.odata.org/OData/OData.svc/Products(1)</uri>
<uri>http://services.odata.org/OData/OData.svc/Products(2)</uri>
<uri>http://services.odata.org/OData/OData.svc/Products(3)</uri>
<uri>http://services.odata.org/OData/OData.svc/Products(4)</uri>
<uri>http://services.odata.org/OData/OData.svc/Products(5)</uri>
<uri>http://services.odata.org/OData/OData.svc/Products(6)</uri>
</links>As described in [OData-Operations] OData services may expose custom behaviors via Service Operations, which may accept input parameters identified by the request URI (as described in [OData-URI]). This section specifies how the results of a Service Operation are formatted using Atom or XML. Service operations support returning:
If a Service Operation returns a collection of Entries or a single Entry, then the Entries (or Entry) are formatted in Atom as described in the Representing Collections of Entries or Representing an Entry section.
If a Service Operation returns a single primitive value, then it is formatted in XML as per the Representing Primitive Properties section. Likewise, if a Service Operation returns a single Complex Type value, then it is represented in XML as per the Representing Complex Type Properties section.
If a Service Operation returns a collection of primitive values, then the primitives are returned as the value of
<GetInts xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<element>0</element>
<element>1</element>
<element>2</element>
</GetInts>If a Service Operation returns a collection of complex types, then the collection is represented in XML by a root element whose name is equal to the name of the Service Operation and includes one child
<GetAddressses xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<element type="SampleNamespace.Address">
<street>123 Contoso Ave</street>
<city>London</street>
</element>
<!-- additional Addresses returned go here -->
</GetAddresses>