Hi,

I am having troubles handling wrong method calls. When calling a resource with 
inappropriate method (e.g. POST instead of GET), wink identifies the resource 
doesn't support the requested method, and generates a WebApplicationException 
with status code 405. (so far so good :-) )
For some reason the http error code 405 is not part of the Status class, so 
calling valueOf doesn't generate the appropriate Status object instance. I 
guess that's not a wink issue, as it is not part of the javax.ws.rs spec either.

The HTP spec says that when returning 405 error, the server also MUST set the 
Allow header. Taken from w3 HTTP 1.1 Spec :

----

10.4.6 405 Method Not Allowed

The method specified in the Request-Line is not allowed for the resource 
identified by the Request-URI. The response MUST include an Allow header 
containing a list of valid methods for the requested resource.

----

Do you have any idea how do I build the appropriate response object for this 
case (setting the Allow header with relevant values)? Does wink have anything 
out of the box to handle it?

Thanks,
Lior

Reply via email to