|
From: Bill B. <bb...@re...> - 2008-04-09 18:56:14
|
Ok, this is fixed in trunk/ I'm traveling the next week, so I won't be
able to do another release in 2 weeks or so. Please check out trunk if
you want this bug fix.
Bill
Bill Burke wrote:
> Ok, thanks. I'll take a look sometime today and put out a patch
> tomorrow. I think I'm just not matching on properties. I thought I
> was, guess not.
>
> Christian Sadilek wrote:
>> Hi Bill,
>>
>> thanks for your reply. this is exactly what I tried to do:
>>
>> I have the following 4 methods:
>> @ProduceMime("application/xml;schema=foo")
>> @GET
>> public String getMeFoo(@PathParam("obj-id") int objectId) {
>> return "<foo>"+objectId+"</foo>";
>> }
>>
>> @ProduceMime("application/xml;schema=bar")
>> @GET
>> public String getMeBar(@PathParam("obj-id") int objectId) {
>> return "<bar>"+objectId+"</bar>";
>> }
>>
>> @ConsumeMime("application/xml;schema=foo")
>> @PUT
>> public void putMeFoo(String xml) {
>> System.out.println("foo");
>> }
>>
>> @ConsumeMime("application/xml;schema=bar")
>> @PUT
>> public void putMeBar(String xml) {
>> System.out.println("bar");
>> }
>>
>> I used the same annotations on the client interface and created it using
>> the ProxyFactory.
>> @GET
>> @ProduceMime("application/xml;schema=foo")
>> public String getMeFoo(@PathParam("obj-id") int objectId);
>>
>> @GET
>> @ProduceMime("application/xml;schema=bar")
>> public String getMeBar(@PathParam("obj-id") int objectId);
>>
>> @PUT
>> @ConsumeMime("application/xml;schema=foo")
>> public void putMeFoo(String xml);
>>
>> @PUT
>> @ConsumeMime("application/xml;schema=bar")
>> public void putMeBar(String xml);
>>
>> However, only the "foo methods" are called (even if I call getMeBar() or
>> putMeBar()). I tried it with beta1 and beta2.
>> Am I doing something wrong?
>>
>> As far as I was able to trace the problem I end up with 4 different
>> uriParamChildren in the root PathSegmentNode. 2 for GET and
>> 2 for PUT. The first one to be analyzed in
>> PathSegmentNode.findResourceInvoker always wins because the media types
>> are compatible as MediaType.isCompatible() "only" checks for the type
>> and subtype (not for any mime properties).
>>
>> Thanks again for your help.
>>
>> king regards,
>> Christian Sadilek
>>
>> 2008/4/7, Bill Burke <bb...@re... <mailto:bb...@re...>>:
>>
>> Sorry, that should be
>>
>> @ConsumeMime("application/xml;schema=foo")
>> @PUT
>> public void putMe(String xml) {}
>>
>>
>> Bill Burke wrote:
>>
>> Christian,
>>
>> It doesn't work already?
>>
>> Can't you do:
>>
>> @ConsumeMime("application/xml;schema=foo")
>> @GET
>> public String getMe() {}
>>
>> Or do you mean something else?
>>
>>
>> FYI, to subscribe:
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>>
>>
>> Christian Sadilek wrote:
>>
>> Hi Bill,
>>
>> are there any plans to support MIME properties for XML
>> content negotiation in RESTeasy like you described in your
>> Blog
>> http://bill.burkecentral.com/2008/03/05/restful-xml-content-negotitation?
>>
>> I would like to expose two different xml representations of
>> a resource and the solution you presented would fit perfectly.
>>
>> Thank you!
>>
>> I hope it's o.k. to send you this email directly. I could
>> not find a user forum.
>>
>> kind regards,
>> Christian Sadilek
>>
>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|