Hi,
I've got a quiestion regarding wadl generation in tomee/cxf/rest

I'm not quite sure if this is a tomee issue, but maybe someone has seen this
before.

A simple rest method:

    @POST
    @Consumes("application/json")
    @Produces("application/json")
    public Response putJson(User user) {
        return Response.ok().build();
    }

The user is just a plain pojo annotated with @xmlrootelement


the wadl (resource/?_wadl) produces:

<application xmlns="http://wadl.dev.java.net/2009/02";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<grammars>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<xs:element name="user" type="user"/>
<xs:complexType name="user">
<xs:sequence>
<xs:element minOccurs="0" name="age" type="xs:int"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</grammars>
<resources base="http://localhost:8080/GlassfishRest/webresources/";>
<resource path="/generic">
<method name="POST">
<request>
<representation mediaType="application/json"/>
</request>
<response>
<representation mediaType="application/json"/>
</response>
</method>
</resource>
</resources>
</application>

In jersey :

<grammars>
<include href="application.wadl/xsd0.xsd">
<doc title="Generated" xml:lang="en"/>
</include>
</grammars>
<resources base="http://localhost:8080/GlassfishRest/webresources/";>
<resource path="generic">
<method id="putJson" name="POST">
<request>
<ns2:representation element="user" mediaType="application/json"
xmlns:ns2="http://wadl.dev.java.net/2009/02"; xmlns=""/>
</request>
<response>
<representation mediaType="application/json"/>
</response>
</method>
</resources>

Until now I have'nt been able to produce the <element=&quot;user&quot;>
description in the method.
Is there a missing cxf configuration to make apache cxf produce this?

best regards,
hw



--
View this message in context: 
http://openejb.979440.n4.nabble.com/tomee-rest-wadl-generation-tp4667900.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to