Hi
at the moment it is only text/plain that is supported for primitives.
so only registering a custom writer would convert them into xml.
I'll have to allocate some time later on and probably convert primitives
into something like
<int>3</int> and {"int":3} for JSON...
cheers, Sergey
Gabriel Guardincerri wrote:
>
> Hi,
>
> 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?
>
> Thanks,
>
> Gabriel
>
--
View this message in context:
http://www.nabble.com/MIME-type-problem-with-a-service-that-returns-int-and-also-an-error-xml-message-tp25530432p25530458.html
Sent from the cxf-user mailing list archive at Nabble.com.