File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jaxrs webservice put and post methods return : HTTP/1.1 415 Unsupported Media Type error

 
I Lopes de Sarria
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a basic CRUD webservice. The lookups (@GET methods) work but the create/edit/deletes are giving the Unsupported Media Type error ie:

SEVERE [org.jboss.resteasy.core.SynchronousDispatcher] (http--127.0.0.1-8080-3) Failed executing POST /Funds/create: org.jboss.resteasy.spi.UnsupportedMediaTypeException: Cannot consume content type
at org.jboss.resteasy.core.registry.Segment.match(Segment.java:117) [resteasy-jaxrs-2.3.2.Final.jar:]

I have tried different method signatures to no avail:


and the class signature for the Fund entity is:

...

Can anyone see anything obviously wrong with this?
Many thanks
 
I Lopes de Sarria
Greenhorn
Posts: 12
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved. In the client to test the call, i needed to add a header: Content-Type: application/xml and if receiving XML back then an additional Content-Type of "Accept"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic