我是odata4j概念的新手。使用tomcat库odata4j -0.5-nojpforforle.jar使用链接http://code.google.com/p/odata4j/wiki/Tomcat在odata4j上启动producer。我的生产者被修改为给出一个很大的整数列表,作为一个称为" integers“的实体集,我可以检索serviceDoc集合,并且可以应用过滤器。现在正在尝试对此服务文档执行post,尝试添加具有相同架构的多个条目。
使用post body为http://localhost:8080/OData/example.svc/Integers执行post:
<?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不可接受的未知内容类型application/xml;charset=UTF-8。Int集合内容类型为application/xml。仍然不能找出为什么会得到这样的回应。有人知道我错过了什么吗。
提前谢谢。
发布于 2012-01-09 07:08:07
应用程序使用Content-Type
请参阅:http://www.odata.org/developers/protocols/operations#CreatingnewEntries
希望这能有所帮助,
https://stackoverflow.com/questions/8676913
复制相似问题