English 中文(简体)
OData AtomPub Formatting: application/xml vs application/zip
原标题:OData AtomPub formatting: application/xml vs. application/zip

在研究一些OData的答复时,我看到,这些结构根据它们是否拥有适用于应用/xml或应用/zip的内容类型而略有不同。 以下是两个例子:

  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>

两者都作为AtomPub(斯坦福RSS schema为OData所使用),但是,如果内容属于“申请/申请”类型,则质量要素与内容相同,如果是“申请/xml”,则属于“联系”的分部分。 根据在odata.org上的OData规格,第二种格式是正确的。 是否有任何人知道第一种格式为何也得到使用(甚至被DAata客户了解)?

预 收

最佳回答

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.

问题回答

我收到了以下答复:。 OData 谷歌组:

If an entity type is marked as a Media Link Entry, i.e. it is backed by media, it s properties are not present in the element of the atom:entry element. And the content element points to the location to download the backing media from. Another example of such an entity is the Titles collection in Netflix s feed. http://odata.netflix.com/v2/Catalog/Titles?$top=1 You mention below that you are having trouble parsing such entity types in Atom, how are you parsing the ATOM feed ? Are you using one of our client libraries or are you parsing the response by hand ?

Reference : https://www.rfc-editor.org/rfc/rfc5023#page-25

Phani Raj Yayavaram Narasimha





相关问题
Create a new blog post using AtomPub and .NET

I need to create a new blog post from an application I am writing. Currently the target bloging engine is BlogEngine.net and probably WordPress in the near future. It was suggested to me to use ...

curl query to check out a document using CMIS

I am trying to checkout a document using the REST-based CMIS protocol, but I get an error from the server (Alfresco). Am I misusing curl? Or am I missing something in my request? curl --user admin:...

Atom entry with C#

How can I make an Atom entry with C# and .NET 4 ? I need to make an entry with this structure: <entry xmlns="http://www.w3.org/2005/Atom" xmlns:f="XXX:aaa"> <title>title1</title> ...

Java web CMS & HTML presentation, templating

I m looking for a content management system in java with good support for html content presentation in sense of web presentations, NOT document management or enterprise content management I m ...

Does anybody know of an Atom APP server for .Net?

I m aware of the Argotic framework for .Net that assists in the collation and management of Atom data, but does anybody know of a .Net application/framework that implements the Atom Publishing ...

How to use "SelectMany" with DataServiceQuery<>

I have the following DataServiceQuery running agaist an ADO Data Service (with the update installed to make it run like .net 4): DataServiceQuery<Account> q = (_gsc.Users .Where(c =...

热门标签