I don't think you seem to be missing anything. I tried using Wink 1.1.2 and this test code (changing ruleId to id in the GET) and it seemed to work. When I invoked "curl -X DELETE http://.../test/1234", the SystemOut log did show "id: 1234". (One thing that did catch me was that the test code only outputs the id to the systemout log, not in the response message, for the delete and that threw me off for a few minutes).
If you can, can you enable org.apache.wink.*=all trace and see if there's something like the following? [4/11/11 9:33:07:579 CDT] 0000001e InvokeMethodH 3 org.apache.wink.server.internal.handlers.InvokeMethodHandler handleRequest Invoking method removeIt of declaring class org.apache.wink.example.helloworld.TestResource on the instance of a class org.apache.wink.example.helloworld.TestResource@64566456 with parameters [1234] [4/11/11 9:33:07:579 CDT] 0000001e SystemOut O id: 1234 BTW, just as a disclaimer, official support for WebSphere is provided by their normal channels. On Mon, Apr 11, 2011 at 6:54 AM, Stefan Witte <[email protected]> wrote: > Hi > > I'm a bit confused about a DELETE on a resource. When i do a DELETE > request (../test/123) the removeIt method is called but the PathParam > ("id") is null. > If i remove the @GET getIt method from the class then the id is not null, > it then contains the value "123". > > What am i missing ? > > Using wink 1.1.2 on WebSphere 7.0.0.15 > > @Path("test") > public class TestResource { > > @GET > @Produces(MediaType.APPLICATION_JSON) > @Path("{id}") > public String getIt(@PathParam("id") String ruleId, > @QueryParam("layout") String layout) { > System.out.println("GET id: " + id); > return "get " + id; > } > > @POST > @Consumes(MediaType.APPLICATION_JSON) > @Produces(MediaType.APPLICATION_JSON) > public String storeIt(String jsonString) { > System.out.println("POST: " + jsonString); > return "store " + jsonString; > } > > @DELETE > @Path("{id}") > public Response removeIt(@PathParam("id") String id) { > System.out.println("id: " + id); > return Response.status(Response.Status.OK).build(); > } > } > > Thanks. > > Stefan. >
