On Thu, May 27, 2010 at 11:10 AM, Luciano Resende <[email protected]> wrote:
> On Thu, May 27, 2010 at 11:07 AM, Raymond Feng <[email protected]> wrote:
>> Hi,
>> We generate the @Produces and @Consumes at resource class level based on the
>> wire formats. For the @GET method, the @Consumes should be ignored by wink.
>> I think it's probably a bug in Apache wink. I'll try to follow up with them.
>
> Great, but should we have at least a workaround for this release ?
> Anyway, I have created TUSCANY-3572 to track this issue.
>
> [1] https://issues.apache.org/jira/browse/TUSCANY-3572
>
>
I went ahead and tried a similar scenario using JAX-RS without Tuscany
(see [1] for source).
The following interface seems to work fine with JAX-RS
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface Catalog {
@GET
@Produces(MediaType.APPLICATION_JSON)
List<Item> get();
@GET
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
Item get(@PathParam("id") String id);
}
But, the following does not.
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface Catalog {
@GET
List<Item> get();
@GET
@Path("{id}")
Item get(@PathParam("id") String id);
}
So it really seems related to having the @Consumes in the interface
level and nothing else on the method level.
[1]
https://svn.apache.org/repos/asf/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/