Hi
On 25/04/16 08:48, Vjacheslav V. Borisov wrote:
Hi!

Trying to generate code from WADL with references
http://cxf.apache.org/docs/jaxrs-services-description.html#JAXRSServicesDescription-
WADLwithreferences


I am getting strange results
1.
@Path("/books")
public interface BooksResource {

}

2.

@Path("/bookstore/{id}")
public interface BookstoreIdResource {

     @GET
     @Produces("application/xml")
     Book get(@PathParam("id") String id);

}


Why (1) public interface BooksResource is empty?
Shouldn't it contain method that returns subresource instance ?

The fact that example shows one resource enclosing another one does not mean the enclosed one needs to be generated as a JAX-RS subresource class (this is only possible to do with adding id attributes to WADL that can be understood by CXF, ids being class names),

it is equivalent to a commented code in that example, however the fact the interface is empty is a problem, can you please try the commented out fragment instead ?


Why (2) contains Book get(..) method,
Shouldn't it also contain method that returns subresource instance ?

Not sure I understand this question.
<resource path="/bookstore/{id}" type="#bookResource"/>

refers to a resource fragment where a GET method is defined

Cheers, Sergey

--
Sergey Beryozkin

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

Reply via email to