Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 54745 invoked from network); 22 Nov 2010 16:25:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Nov 2010 16:25:12 -0000 Received: (qmail 4402 invoked by uid 500); 22 Nov 2010 16:25:44 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 4284 invoked by uid 500); 22 Nov 2010 16:25:42 -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 4264 invoked by uid 99); 22 Nov 2010 16:25:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Nov 2010 16:25:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Nov 2010 16:25:39 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAMGPGFh015945 for ; Mon, 22 Nov 2010 16:25:17 GMT Message-ID: <28376760.235651290443116964.JavaMail.jira@thor> Date: Mon, 22 Nov 2010 11:25:16 -0500 (EST) From: "Guy Dumais (JIRA)" To: issues@cxf.apache.org Subject: [jira] Commented: (CXF-3135) WadlGenerator does not respect Consumes annotation In-Reply-To: <16489141.180291290108016138.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934503#action_12934503 ] Guy Dumais commented on CXF-3135: --------------------------------- Here is the example I was concerned with. It seems that these two methods should generate the same *request representation* element but there are not: {code} @Service("wadlTest") @Path("/resource") @Description("Shouldn't these two cases give the same representation") public class WadlTest { org.apache.cxf.jaxrs.model.wadl.WadlGenerator wadl; @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) @Description("using MultiValuedMap gives application/x-www-form-urlencoded") public String postWithMultiValued(MultivaluedMap formParams) { String stringParam = formParams.getFirst("stringParam"); long longParam = Long.parseLong(formParams.getFirst("longParam")); return "{}"; } @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) @Description("using FormParam gives application/json") public String postWithFormParam(@FormParam("stringParam") String stringParam, @FormParam("longParam") long longParam) { return "{}"; } } {code} The generated WADL with CXF 2.2.9 is {code:xml} Shouldn't these two cases give the same representation using MultiValuedMap gives application/x-www-form-urlencoded using FormParam gives application/json {code} > WadlGenerator does not respect Consumes annotation > -------------------------------------------------- > > Key: CXF-3135 > URL: https://issues.apache.org/jira/browse/CXF-3135 > Project: CXF > Issue Type: Bug > Affects Versions: 2.3.0 > Environment: any > Reporter: Guy Dumais > Priority: Minor > > {{WadlGenerator}} invokes {{handleRepresentation}} with the wrong parameter when creating the {{}} element. The last parameter of {{handleRepresentation}} should be _true_ not _false_: > {code} > if (ori.getMethodToInvoke().getParameterTypes().length != 0) { > sb.append(""); > if (isFormRequest(ori)) { > handleRepresentation(sb, jaxbTypes, qnameResolver, clsMap, ori, null, false); > } else { > for (Parameter p : ori.getParameters()) { > handleParameter(sb, jaxbTypes, qnameResolver, clsMap, ori, p); > } > } > sb.append(""); > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.