cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <>
Subject WADL generation: linkJsonToXmlSchema & XMLName
Date Tue, 15 Oct 2013 12:07:27 GMT
I am currently trying to enrich the WADL auto-generated by CXF 2.7.7 in 

I currently have these Spring beans defined:

   <bean id="wadlGenerator" 
     <property name="applicationTitle" value="Apache Syncope 
     <property name="namespacePrefix" value="syncope"/>
     <property name="linkJsonToXmlSchema" value="true"/>
     <property name="useJaxbContextForQnames" value="true"/>
     <property name="ignoreMessageWriters" value="true"/>
     <property name="addResourceAndMethodIds" value="true"/>


   <jaxrs:server id="restContainer" address="/" 
       <!-- snip -->
       <ref bean="jaxbProvider"/>
       <ref bean="jsonProvider"/>
       <ref bean="exceptionMapper"/>
       <ref bean="wadlGenerator"/>

I am currently testing one of available services that now looks as 
follows (showing only a couple of methods for simplicity):

public interface UserService {

             @Description(target = DocTarget.METHOD, value = "Returns a 
single user matching the provided userId"))
     UserTO read(@PathParam("userId") Long userId);

     List<UserTO> list();

Now, while the former becomes (in the WADL)

<method name="GET" id="read">
   <doc>Returns a single user matching the provided userId</doc>
     <representation mediaType="application/xml" element="syncope1:user"/>
     <representation mediaType="application/json" element="syncope1:user"/>

which is just fine, the latter is instead reported as

<method name="GET" id="list">
     <representation mediaType="application/xml" element="syncope1:users"/>
     <representation mediaType="application/json" element="syncope1:user"/>

As you can see, representation/@element is different between JSON and 
XML, e.g. for XML the value provided via @XMLName is used, while for 
JSON it is reported as if the return type was plain 'UserTO' instead of 
Without @XMLName, element attribute is not even reported for XML.

Moreover, I would expect to find something in the <schema> section of 
the WADL for '{}users', as [1] seems to 

Any clue?



Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member

View raw message