dev@jersey.java.net

Re: mediatype attribute missing from representation element in generated WADL file

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 18 Jul 2007 11:29:41 +0200

Peter Liu wrote:
> BTW, this is what's causing the 406 (unacceptable) status code I
> mentioned before since we don't
> know the media type.
>

But for a 406 response are you still getting the representation
returned? If so that is another bug.

If you don't specify any content type in the request then the runtime
should choose one for you [*].

Paul.

[*] Not that since the xml and json are equally valid it is not clear
which one takes precendence. It is planned to implement the quality
parameter, 'q', so that it is possible to prefer XML over JSON.

>
> Peter
>
> Ayub Khan wrote:
>> Hi Marc/Paul,
>>
>> I am using latest GF b55 with jersey 0.2. Using latest REST tooling
>> source, I am seeing the following in generated wadl
>> file.
>>
>> <application xmlns="http://research.sun.com/wadl/2006/10">
>> <resources base="%%REPLACE%%/resources">
>> <resource path="/customers/">
>> <method name="GET">
>> <response>
>> <representation/>
>> </response>
>> </method>
>> <method name="GET">
>> <response>
>> <representation/>
>> </response>
>> </method>
>> ...
>> instead of
>>
>> <application xmlns="http://research.sun.com/wadl/2006/10">
>> <resources base="%%REPLACE%%/resources">
>> <resource path="/customers/">
>> <method name="GET">
>> <response>
>> <representation mediatype="application/xml"/>
>> </response>
>> </method>
>> <method name="GET">
>> <response>
>> <representation mediatype="application/json"/>
>> </response>
>> </method>
>> ...
>>
>> This is same for POST too.
>>
>> Attached is the application.wadl and the CustomerResource.java
>>
>> Thanks
>> Ayub
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109