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.

Thanks,
Raymond

________________________________________________________________ 
Raymond Feng
[email protected]
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On May 27, 2010, at 10:55 AM, Luciano Resende wrote:

> On Wed, May 26, 2010 at 11:07 PM, Luciano Resende <[email protected]> 
> wrote:
>> I'm prototyping some integration of the REST Binding in PhotArk, which
>> is configured to use JSON wireformat. When I try to test the service
>> by invoking the URL via browser URL [2]  I keep getting the following
>> error in the console... which seems to be related to no accept header
>> being passed from a simple browser GET.
>> 
>> INFO: Could not find any method in class
>> org.apache.photark.services.GeneratedGalleryServiceImpl that consumes
>> null
>> May 25, 2010 11:03:10 PM
>> org.apache.wink.server.internal.RequestProcessor logException
>> INFO: {0} occurred during the handlers chain invocation
>> 
>> Do we still have support for declarative wire format configuration on
>> the composite file after recent changes on the REST Binding ?
>> 
>> 
>> [1] 
>> https://svn.apache.org/repos/asf/incubator/photark/sandbox/lresende/photark-rest
>> [2] http://localhost:8085/gallery/
>> 
> 
> I was able to narrow down the issue, it seems that the generated
> Resource interfaces force a @Consume annotation based on the
> configured wireFormat (in my case JSON) and the regular GET url in the
> browser only sends default HTML specific accept headers. If we remove
> the @Consume from the generated interface or if we force accepts to
> include "application/json" this then start working again. My question
> really is, do we need to force @Consume annotation to HTTP operations
> that does not really expects payloads such as GET, DELETE, and we
> probably need to look ahead and check if we need to force @Produce
> annotation on HTTP operations that does not produce any payload such
> as DELETE, maybe POST ?
> 
> 
> Thoughts ?
> 
> -- 
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/

Reply via email to