Hi Gabo
Hi Sergey,
Given he following:
@WebService(name="MyService", targetNamespace="http://some.domain.com/")
@SOAPBinding(use=Use.LITERAL, style=Style.RPC)
@Consumes("text/xml")
@Produces("text/xml")
@Path("/")
public interface MyService {
@GET
@Path("/search/")
@WebMethod
@WebResult(name="myObjects")
public List<MyObject> getMyObjects(...);
}
and
@XmlType(name="MyObject", namespace="http://some.domain.com")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="MyObject", namespace="http://some.domain.com")
public class MyObject
The object description is accurate. However, the method is displayed as follows:
<resource path="/search/">
<method name="GET">
<request>
...
</request>
<response>
<representation mediaType="text/xml"/>
</response>
</method>
</resource>
Are lists not supported for WADL?
I kind of referred to it a couple of times already. Basically, even though JAX-RS implementations do let people write resource
methods accepting/returning explicit collections, it is really a convinience hack which is something I've relied upon too in my own
JAX-RS services coding.
The question, what is the schema type for say Collection<Bar> ? Or Set<Foo> or List<Baz> ? CXF JAXRS JAXBElementProvider lets users
customize the name of the enclosing collection root, so it is really tricky to have a schema generated for say List<MyObject>.
If users would like to have their collections of JAXB types be described in WADLs then I'd recommend wrapping them, ex, in, say,
MyObjects JAXB class...
I might consider configuring the WADLGenerator such that it uses the registered JAXBProvider to get the actual JAXBContext
representing a given explicit collection and using it to have the schema generated...
hope it helps, Sergey
Thanks in advance.
Gabo
Sergey Beryozkin wrote:
Hi Gabo
Hi Sergey,
Sorry about that. But you did get the idea tho. :D
Is it the wadl:request element which has no links to the schema types ? If yes then it is expected when @Consumes is set to
*/*, given that it may even be that only a non-XML format which is accepted by a method...
Shouldn't the method still show some description of what the method is expecting? Maybe a redundancy of what was described in
the grammar.
See
http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/Description.java
I would be trying having multiple specific values and update this thread of the results. Might take a while, got dragged to
another task.
Having @Consumes with multiple values will result in the generated WADL
reflecting it. Same for @Produces.
hope it helps, Sergey
Thanks again!
Gabo
cheers, Sergey