users@wadl.java.net

Re: Introduction and First Question: Modeling separate resource groups for HTTP & HTTPS

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 29 May 2008 14:30:06 -0400

Unfortunately there's no simple/canonical way to do this in one WADL
document due to the cardinality of the resources element.

I would use three WADL documents, one for the http specific resources,
one for the https specific resources and a third for the common
resources shared between the two. The first two would use the
reference form of the resource element to refer to the common
resources in the third.

An alternative is to define an extension element or attribute that you
can use to mark which resources are available via http or https - the
content model for most elements is open to extensions.

Marc.

On May 29, 2008, at 2:13 PM, Don Song wrote:

> Hello, first a brief introduction. I'm the founder and chief
> developer/architect of a company developing a web-based IT asset
> management system which exposes a REST based web service interface.
>
> I initially defined my interface using a custom ad-hoc XML schema
> but recently discovered WADL (thanks to the O'reilly book on RESTful
> web services) and found that it was very similar to what I've been
> doing. So I've started to migrate my interface definitions to WADL
> to better align my work with common standards and terminology. I am
> more interested in the WADL standard and not on the java libraries,
> since my product is based on .NET (C#). I have written a basic WADL
> object model/parser in .NET (C#) which is not complete but suits my
> immediate needs.
> Anyway, on to my first question:
>
> I have a set of resources that need to be secured using HTTPS and
> another set which does not. I have not found a good way to model
> this in a single WADL document, given my current understanding of
> the spec.
>
> The simplest approach I could think of was to have to multiple
> resources elements, like so:
>
> <resources base="https://example.com">
> <doc>secured interface</doc>
> ...
> </resources>
>
> <resources base="http://example.com>
> <doc>unsecured interface</doc>
> ...
> </resources>
>
> However, it seems the current XML schema (dated 2006/10) only allows
> one resources element in a document.
> Then I thought I could use resource_type element for each group, but
> this element is used to model a single resource, not a group of
> resources.
>
> Am I missing something here? Is there some elegant/canonical way to
> handle this?
>
> Regards,
> Don
>
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.