【发布时间】:2011-12-30 06:42:35
【问题描述】:
我是 odata4j 概念的新手。 使用 odata4j 库 odata4j-0.5-nojpabundle.jar 使用链接在 tomcat 上启动生产者 http://code.google.com/p/odata4j/wiki/Tomcat。 我的生产者被修改为提供大量整数作为实体集,称为“整数” 我可以检索 serviceDoc、collection 并可以应用过滤器。 现在尝试在此服务文档上执行发布[尝试添加一个具有相同架构的条目]。
为http://localhost:8080/OData/example.svc/Integers发帖 带有帖子正文:
<?xml version="1.0" encoding="utf-8" ?> <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <entry> <id>http://localhost:8080/OData/example.svc/Integers(100)</id>
<title type="text" />
<updated>2011-12-29T10:50:33Z</updated>
<author> <name /> </author>
<link rel="edit" title="Integers" href="Integers(100)" />
<category term="example.Integers" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:EntityId m:type="Edm.Int32">100</d:EntityId> </m:properties>
</content>
</entry>
我得到 406 not Acceptable Unknown content type application/xml;charset=UTF-8。 Int 集合内容类型为 application/xml。仍然无法找出为什么会获得此响应。 有谁知道我在这里缺少什么。
提前致谢。
【问题讨论】: