File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes 406 when trying to resolve xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "406 when trying to resolve xml" Watch "406 when trying to resolve xml" New topic
Author

406 when trying to resolve xml

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 223
Hello:

My REST service looks like this:



I send the following URL:

http://localhost::9081/contextroot/SIMS/get/2828/1234567890.xml

which has an Accept header of "text/xml"

My view resolver looks like:



I get a 406 response. I've tried to make it as explicit as possible that I want XML returned. Does anybody spot a problem?

THanks
Eric
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

When I googled for the HTTP Accept header, the link I found (from Wikipedia) suggested it should look like "Accept: text/xml". Yours doesn't quite look like that.
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 223
Thanks, all I needed to do is use JAXB annotations in the object I wanted to convert.


eric
 
 
subject: 406 when trying to resolve xml
 
Threads others viewed
selectOneMenu to a managed bean
Automatic Schema Generation
ContentNegotiatingViewResolver
trouble parsing stream or string into xml
Spring + JPA + Hibernate and multiple Database connection
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com