cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christos Fragoulides (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-3797) WADL2Java Generator improvements
Date Fri, 09 Sep 2011 15:45:09 GMT

    [ https://issues.apache.org/jira/browse/CXF-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101284#comment-13101284
] 

Christos Fragoulides commented on CXF-3797:
-------------------------------------------

You're welcome.

The patch have been created against the source I've checked out from trunk. The version in
the pom is 2.5.0-SNAPSHOT.
Are you referring to CXF-3759? When I first started checking the code, I did it with 2.4.2
sources and this issue was in place.
In the latest source the issue had been fixed, but it was a different case (multiple <response>
elements with one status each). The patch I've attached deals with multiple status codes defined
in the @status attribute of a single <response> element.
See this link for details: http://www.w3.org/Submission/wadl/#x3-200002.10

I will attach the full file so you can diff easier with the latest one.

> WADL2Java Generator improvements
> --------------------------------
>
>                 Key: CXF-3797
>                 URL: https://issues.apache.org/jira/browse/CXF-3797
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>            Reporter: Christos Fragoulides
>              Labels: patch
>             Fix For: 2.5
>
>         Attachments: wadl2java_patch.zip
>
>
> Given a relatively complex WADL file (such as the one provided by Rackspace Cloud Servers
API), JAX-RS WADL2Java Generator has many difficulties generating the proper Java classes.
> To name a few:
> - Generated method parameter names may be invalid. For example a header parameter named
'X-Auth-Token' will not have the dashes removed before being converted to a Java method parameter.
This results in invalid generated source.
> - @Produces annotation is not applied to methods, when the corresponding <response>
element contains more that one representation elements.
> - Resolved XML-schemata(from the <grammars> section of the WADL) may contain included
schemata.
> - The status attribute of the <response> element may contain a list of status codes.
The generator is expecting none or a single entry. Also the generator looks only for HTTP
status 200, while there are more valid codes, like 203.
> - The generated class names may collide with names of JAXB generated classes. For example
a resource named 'Limits' may need to import a JAXB generated class also named 'Limits' this
will trigger compilation errors.
> We were trying to use the generator in order to create and use CXF Client Proxies for
the RESTful web service mentioned above. This was necessary for us since we need to use the
API for managing Radiojar, the main project we are currently working on.
> I ended up checking out the source for JAX-RS Frontend and trying to fix the bugs in
SourceGenerator.
> Finally I managed to address the problems, so I will attach a patch to this issue, along
with the WADL file and the imported XSDs.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message