0

Am a newbie in odata4j concepts. Using odata4j Library odata4j-0.5-nojpabundle.jar launched producer on tomcat using link http://code.google.com/p/odata4j/wiki/Tomcat. My producer is modified to give an large list of integers as an entity-set called "Integers" I could retreive the serviceDoc,collection and can apply filters. Now trying to perform post on this service doc[trying to add one more entry with same schema ].

Doing post for http://localhost:8080/OData/example.svc/Integers with post body :

    <?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>

am getting 406 not Acceptable Unknown content type application/xml;charset=UTF-8. Int collection content type is application/xml. Still not able to find out why is this response is obtained. Does anyone know what i am missing here.

Thanks in Advance.

kshama
  • 1,637
  • 4
  • 18
  • 21

1 Answers1

0
  1. Use application/atom+xml as the Content-Type
  2. Entry should be the document element (your xml above is not well-formed)

See: http://www.odata.org/developers/protocols/operations#CreatingnewEntries

Hope that helps,
- john

John Spurlock
  • 1,723
  • 1
  • 13
  • 12