如何让 ATOM 阅读器(例如 RSSOwl)显示<内容>ATOM feed 的元素?内容>
如果我以错误的方式看待这个问题,请随时指出。
我正在读一本关于 WCF 的书。本书展示了如何创建返回 ATOM 提要的 WCF 服务。
服务有效。我将浏览器指向正确的 URL 并获得 ATOM 反馈。
浏览器将数据识别为 ATOM 提要,但仅显示项目的日期,而不显示内容。
我使用 Fiddler 检查服务传回的 XML,每个条目如下所示:
<entry>
<id>http://localhost:18696/Calculator/NorthwindDataService.svc/Products(1)</id>
<title type="text"></title>
<updated>2010-12-14T17:04:13Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Product" href="Products(1)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(1)/Order_Details" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(1)/Supplier" />
<category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ProductID m:type="Edm.Int32">1</d:ProductID>
<d:ProductName>Chai</d:ProductName>
<d:SupplierID m:type="Edm.Int32">1</d:SupplierID>
<d:CategoryID m:type="Edm.Int32">1</d:CategoryID>
<d:QuantityPerUnit>10 boxes x 20 bags</d:QuantityPerUnit>
<d:UnitPrice m:type="Edm.Decimal">18.0000</d:UnitPrice>
<d:UnitsInStock m:type="Edm.Int16">39</d:UnitsInStock>
<d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
<d:ReorderLevel m:type="Edm.Int16">10</d:ReorderLevel>
<d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
</m:properties>
</content>
</entry>
我希望 ATOM 阅读器能够显示元素的内容,并允许我选择哪些列(例如 ProductID、ProductName 等) .) 显示。
有没有办法用标准 ATOM 阅读器来做到这一点?
或者我对这个应用程序的要求太多了?
ATOM 阅读器是否只是为了显示新闻而设计,而您需要自己获取任何自定义数据?
谢谢!
亚当·莱弗特 http://www.leffert.com
Please feel free to point out if I am looking at this problem the wrong way.
I'm working through a book on WCF. The book shows how to create a WCF service that returns an ATOM feed.
The service works. I point a browser to the correct URL and get an ATOM feed back.
The browser recognizes the data as an ATOM feed, but only shows the dates of the items, not the contents.
I used Fiddler to examine the XML that the service is handing back, and each entry looks like this:
<entry>
<id>http://localhost:18696/Calculator/NorthwindDataService.svc/Products(1)</id>
<title type="text"></title>
<updated>2010-12-14T17:04:13Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Product" href="Products(1)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details" type="application/atom+xml;type=feed" title="Order_Details" href="Products(1)/Order_Details" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(1)/Supplier" />
<category term="NorthwindModel.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ProductID m:type="Edm.Int32">1</d:ProductID>
<d:ProductName>Chai</d:ProductName>
<d:SupplierID m:type="Edm.Int32">1</d:SupplierID>
<d:CategoryID m:type="Edm.Int32">1</d:CategoryID>
<d:QuantityPerUnit>10 boxes x 20 bags</d:QuantityPerUnit>
<d:UnitPrice m:type="Edm.Decimal">18.0000</d:UnitPrice>
<d:UnitsInStock m:type="Edm.Int16">39</d:UnitsInStock>
<d:UnitsOnOrder m:type="Edm.Int16">0</d:UnitsOnOrder>
<d:ReorderLevel m:type="Edm.Int16">10</d:ReorderLevel>
<d:Discontinued m:type="Edm.Boolean">false</d:Discontinued>
</m:properties>
</content>
</entry>
I was hoping that the ATOM reader would display the contents of the elements, and allow me to choose which columns (e.g. ProductID, ProductName, etc.) to display.
Is there a way to do this with a standard ATOM reader?
Or am I asking too much of this application?
Are ATOM readers just designed to display news, and you're on your own for any custom data?
Thanks!
Adam Leffert
http://www.leffert.com
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论