> -----Original Message----- > From: Gabriel Guardincerri [mailto:[email protected]] > > We are using REST with JAX-RS and proxy clients. > > We have this method > > @GET > @Path("/{id}/replies/count") > int getNumberOfReplies(@PathParam("id") long id) throws > RemoteBridgeException, IOException; > > > The problem seems to be that since the return type is a primitive int, > the > MINE type of the method is application/octet-stream. That seems to be > true, > since the response is just a number, I mean, not an xml. The problem is > that > we are using a text/xml payload to return a error messages. And there > is the > conflict. We get a no writer found error when returning the error > message. > So I added this > > @Produces("text/xml") > > But now the client says the there is no writer when the method is > returning > a number. > > So now I added > > @Produces("text/xml,application/octet-stream") > > But it isn't working. > > Any ideas about how to solve this? I would prefer to only have > text/xml, is > that possible?
I suggest you simply change the method and return type to return a marshallable object that contains the value you want to produce. You can't really overload return type protocols.
