users@wadl.java.net

RE: Multiple GET methods for same resource

From: Hadley, Marc J <mhadley_at_mitre.org>
Date: Thu, 10 Jun 2010 10:49:48 -0400

Its not a WADL restriction, a parameter can have a fixed value, see the param/_at_fixed attribute:

http://www.w3.org/Submission/wadl/#x3-270002.12.2

The problem is the method name generation in wadl2java. I think you could probably hack that part of the code to ensure you get a unique name, this isn't the first time that name generation has caused this kind of issue.

Marc.

From: Sebastian Paul [mailto:me_at_sebpaul.de]
Sent: Thursday, June 10, 2010 10:45 AM
To: users_at_wadl.dev.java.net
Subject: Re: Multiple GET methods for same resource

Yes, I could even define options for the command parameter, so that only numbers of available commands are valid.
But the goal is to have a schema for each command. Different methods (=commands) have different parameters.

Obviously WADL cannot express our interface :( It lacks the ability of having fixed query parts which determine the concrete method.

I am wondering wether we can reuse some parts of wadl2java. Just for generating a command domain model which can be used both in client and server.

Regards, Sebastian


Am 6/10/2010 4:29 PM, schrieb Andrew Glowik:
PREVIOUS EXAMPLE SHOULD HAVE BEEN...
<param style="query" name="command" type="xsd:string" required="true">

<doc>'retry' or 'delete'</doc>

</param>

On Thu, Jun 10, 2010 at 10:28 AM, Andrew Glowik <andy.glowik_at_bericotechnologies.com<mailto:andy.glowik_at_bericotechnologies.com>> wrote:
Your "command" is a query string. This can be defined in WADL easily. Along with GET, the query string defines your interface formally. Your goal should be met. I suppose you can add a comment in WADL to enumerate query string values.


<param style="command" name="action" type="xsd:string" required="true">

<doc>'retry' or 'delete'</doc>

</param>
Beyond this, sounds like you want wadl2java to generate clients for different query strings. This is a different issue. Sorry, I can not help you here.
On Thu, Jun 10, 2010 at 10:07 AM, Sebastian Paul <me_at_sebpaul.de<mailto:me_at_sebpaul.de>> wrote:
Yes sure, but then the Maven plugin loses any benefit.
Our goal is a formal definition of the interface. Any change would reflect in the generated code. Clients would then have a dependency to that module.

Am 6/10/2010 4:01 PM, schrieb Andrew Glowik:

You can always edit by hand the resulting wadl2java Java source code.