users@wadl.java.net

Issue with specifying methods

From: Houghton,Andrew <houghtoa_at_oclc.org>
Date: Thu, 19 Feb 2009 19:46:52 -0500

I'm trying to write WADL and the current specification doesn't support the HTTP OPTIONS, TRACE and CONNECT methods. In addition, HTTP allows you to create new methods and there is no way to specify them in WADL. Lastly, there appears to be no way to specify as a collective other methods not specified by the schema enumeration. Here is a use case. I want to create a WADL document where I support GET, but for any other method I want to respond with an HTTP 501 Not Implemented status:

<application>
  <resources base="http://example.org/foo/">
    <resource>
      <method name="GET">
        <request />
        <response>
          <representation status="200" />
        </response>
      </method>
      <method name="*">
        <request />
        <response>
          <representation status="501" />
        </response>
      </method>
    </resource>
  </resources>
</application>

I cannot specify a "*" or something else to indicate that when a user agent sends me a method, that I have not explicitly listed under the resource, I want to tell the user agent that I don't implement what they are requesting.

In addition, I could have created a specialized HTTP FOOBAR method for my REST application (no I'm not really planning on doing this) however I currently cannot say in WADL:

  <method name="FOOBAR">
    <request />
    <response>
      <representation status="200" />
    </response>
  </method>

Sure only my server understands that FOOBAR method, but that is the whole reason why I would want to create WADL so my clients know it is available and what its responses are.

As a starting point, is there any chance of getting the HTTP OPTIONS, TRACE and CONNECT methods put in method enumeration in the schema? I think XML schema allows you to have items not specifically in the list, which would satisfy the FOOBAR case, but I don't remember the magic to do it.


Thanks, Andy.