I updated the source generator code to make a 'best effort' to generate the unique method names when no specific ids are available, thanks for the suggestion,

Sergey

On 09/05/12 16:25, Sergey Beryozkin wrote:
Hi
On 09/05/12 04:17, Ted wrote:
how do you include path's in the method names of the generated sub
methods?

i.e. I'm doing java -> wadl -> java development.

I've created a rest service like :

@Component
@Path("/TestRs")
public class TestRs
{
@GET
@Path("helloWorld")
public String helloWorld()
{
return("Hello World! " + (new java.util.Date()));
}

@GET
@Path("helloWorld2")
public String helloWorld2()
{
return("Hello World2! " + (new java.util.Date()));
}
}

It works fine from a browser and the wadl is created (and looks fine
to me).

When I try to run the wadl2java generator I end up with a class stub with

@GET
@Produces("application/octet-stream")
@Path("/helloWorld")
String get();

@GET
@Produces("application/octet-stream")
@Path("/helloWorld2")
String get();

which the fails to compile with "get() is already defined" for obvious
reasons.

I can reproduce it, yes. We did do some work with to make sure the
subresource locators are named uniquely in such cases.

My problem is, how do I make it so it doesn't generate get() and instead
generateds getHelloWorld() or just helloWorld()?

I don't see any options in the generator. I don't see any other way
around
having multiple @GET items in a given wadl/class.

The way to 'fix' it right now is to explicitly configure WADLGenerator
as a provider and set an 'addResourceAndMethodIds' property to true,
which will lead to the generated WADL containing method ids...

I'll look into improving the way the no-id methods are handled...

Thanks, Sergey



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to