odata4j概念の初心者です。 odata4jライブラリの使用odata4j-0.5-nojpabundle.jarは、リンク http://code.google.com/p/odata4j/wiki/Tomcatを使用してtomcatでプロデューサを起動しました。 私のプロデューサは、整数の大きなリストを "Integers"というエンティティセットとして与えるように変更されました 私はserviceDoc、コレクションを取得でき、フィルタを適用できます。 このサービスのドキュメント[同じスキーマを持つエントリをもう1つ追加しようとしています]に投稿を実行しようとしています。406 ODATA4jのポストを実行している間は受け入れられません
ポスト本体と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受け入れられない未知のコンテンツタイプapplication/xmlのを取得しています;のcharset = UTF-8。 Intコレクションのコンテンツタイプはapplication/xmlです。まだこの応答が得られる理由を見つけることができません。 誰も私がここで何が不足しているか知っていますか?
ありがとうございました。エントリは、ドキュメント要素でなければなりませんContent-Typeの