wood burning stoves 2.0*
The moose likes Web Services and the fly likes question relating to an error I got during a rest call to @Get count of my model Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "question relating to an error I got during a rest call to @Get count of my model" Watch "question relating to an error I got during a rest call to @Get count of my model" New topic
Author

question relating to an error I got during a rest call to @Get count of my model

Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46

Hello,

I am new to rest and i try to learn it. I am struggling with a run time error related to the @get count of my model.
I tried to approach it two different ways but still got the same error.
I would like to seek your help if you happen to know what was wrong with my code.

My program is as follow :

I have a simple rest application and it consists of three packages called Order, OrderDAO , and OrderServices.




and I have my Rest simple client project which consists of a simple java program calling my rest service.




Every thing in the simple client program worked fine, except the @Get path("orders").path("count").accept(MediaType.TEXT_PLAIN).get(String.class)) to the rest service. It gave me a run time error saying that GET http://localhost:8080/RestSimpleApp/rest/orders/count returned a response status of 405.
I searched for the error 405 and it basically said that a HTTP Status code of 405 refers to Method Not Allowed. I wonder if my syntax @Get path("orders").path("count").accept(MediaType.TEXT_PLAIN).get(String.class)) is correct? I tried to use MediaType.APPLICATION.XML but it gave me the same error.
I 'd like to get your help if you can shed some light into what I did wrong.

Thank you very much in advance.

Mark




Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46

It worked when I changed the produces type to Text_Plain.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question relating to an error I got during a rest call to @Get count of my model