Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FDB29FC0 for ; Wed, 21 Sep 2011 21:32:49 +0000 (UTC) Received: (qmail 59490 invoked by uid 500); 21 Sep 2011 21:32:49 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 59464 invoked by uid 500); 21 Sep 2011 21:32:49 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 59456 invoked by uid 99); 21 Sep 2011 21:32:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2011 21:32:49 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2011 21:32:48 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D8917A76B9 for ; Wed, 21 Sep 2011 21:32:26 +0000 (UTC) Date: Wed, 21 Sep 2011 21:32:26 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: <2128060200.23.1316640746883.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <626721682.7912.1315574230078.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CXF-3797) WADL2Java Generator improvements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13111315#comment-13111315 ] Sergey Beryozkin commented on CXF-3797: --------------------------------------- Hi I've applied most of the fixes with some modifications. The only two ones which haven't been applied yet are these : + /** + * Christos Fragoulides / 2011-09-08: A method element may contain many representation + * elements, each one defining a different request body element. - going to work on this one and - if (!isRoot) { + /** + * Christos Fragoulides / 2011-09-06: Fixing the following lines. Path annotation + * should only be applied to resource elements, not method elements. Can you please check the source if this last one is still an issue, and if then point to a specific section in WADL then I can try ? Also please check if other fixes result in a better generated code Many thanks, SErgey > 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 > Assignee: Sergey Beryozkin > Labels: patch > Fix For: 2.5 > > Attachments: SourceGenerator.java, 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 element contains more that one representation elements. > - Resolved XML-schemata(from the section of the WADL) may contain included schemata. > - The status attribute of the 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