Hi Marc,
I think you are spot on regarding the tradeoffs. I see some situations
where link to matched resources would be desirable while in other
situations the single round trip bulk get with actual matched resources
would be desirable.
I already have an XSD type defined (ExtrinsicObjectType in rim.xsd
<
http://docs.oasis-open.org/regrep/regrep-core/v4.0/os/xsd/rim.xsd>)
that allows choice of "link to resource" or "resource" in packaging the
result set and another type (RegistryObjectListType in rim.xsd
<
http://docs.oasis-open.org/regrep/regrep-core/v4.0/os/xsd/rim.xsd>)
that can have a collection of ExtrinsicObjectType.
So I think I will go with your suggestion of using an XML document for
the results document and allow for both possibilities, "link to
resource" or "resource" in packaging the result set.
Thanks to you and Andrew both very much for your help.
On 10/31/2012 01:10 PM, Hadley, Marc J wrote:
> The pros of the approach I suggested are:
>
> - The result list is compact and can include whatever metadata you have in a resource-agnostic way
> - The client can determine which of the results it can actually handle and only GET the results it can use
> - No need to use MIME packaging
>
> The cons are:
>
> - Multiple roundtrips to actually get the content of a result
>
> Marc.
>
> On Oct 31, 2012, at 11:58 AM, Farrukh Najmi wrote:
>
>> Hi Marc,
>>
>> Thank you for your help. I realize this thread is not specifically a wadl question.
>>
>> Assuming the matching resources may include binary resources (e.g. images) which of these alternatives is better and why? Thanks again.
>>
>> On 10/31/2012 11:12 AM, Hadley, Marc J wrote:
>>> An alternative would be to return a results document that contains a list of matching resources, metadata about each one (including media type) and a link to GET it from. You could use XML, JSON, RDF, whatever for the results document.
>>>
>>> Marc.
>>>
>>> On Oct 30, 2012, at 8:12 PM, Farrukh Najmi wrote:
>>>
>>>> Specifically, I am wondering if response with mediaType=mime/multipart be the best design?
>>>>
>>>> On 10/30/2012 08:02 PM, Farrukh Najmi wrote:
>>>>> Hi Guys,
>>>>>
>>>>> I am working on a REST interface described by WADL description. A GET operation called "search" needs to be defined that is expected to return a resource that is actually a set of resources that match the specified query. Each resource in the set may be of an arbitrary mediaType.
>>>>>
>>>>> I am wondering how to specify the wadl:response for such a response.
>>>>>
>>>>> Any advice?
>>>>>
>>
--
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com