Search code examples
odataatompub

OData AtomPub formatting: application/xml vs. application/zip


While looking at responses from some OData feeds I saw that their structures are slightly different depending on wether they have content type set to application/xml or application/zip. Here are two examples:

  1. application/zip
<content type="application/zip" /> 
<m:properties>
  <d:Id>Simple.Data.Core</d:Id> 
</m:properties
  1. application/xml
<content type="application/xml">
<m:properties>
  <d:ProductID m:type="Edm.Int32">1</d:ProductID>
</m:properties>
</content>

Both of them are sent as AtomPub (stanard RSS schema used by OData), but in case content has a type "application/zip", m:properties element comes at the same level as content, and if it's "application/xml", it comes as a subelement of "content". According to OData specification at odata.org, the second format is correct. Does anyone know why the first one format is also used (and even understood by OData clients)?

Thanks in advance


Solution

  • Actually both are correct. The first one (with the m:properties outside of content) represents a Media Link Entry (MLE) as per the ATOMPUB spec. The OData format for MLE is described here: http://www.odata.org/developers/protocols/atom-format#RepresentingMediaLinkEntries. The second one is a normal non-MLE entity.