Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7427076CA for ; Tue, 4 Oct 2011 06:52:02 +0000 (UTC) Received: (qmail 43000 invoked by uid 500); 4 Oct 2011 06:52:02 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 42664 invoked by uid 500); 4 Oct 2011 06:52:00 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 42649 invoked by uid 99); 4 Oct 2011 06:51:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2011 06:51:58 +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; Tue, 04 Oct 2011 06:51:55 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E045C2A7DB6 for ; Tue, 4 Oct 2011 06:51:33 +0000 (UTC) Date: Tue, 4 Oct 2011 06:51:33 +0000 (UTC) From: "Rich Newcomb (Updated) (JIRA)" To: dev@camel.apache.org Message-ID: <58094921.6438.1317711093920.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1991275030.6176.1316779106096.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-4480?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Rich Newcomb updated CAMEL-4480: -------------------------------- Attachment: camel-4480-trunk.patch The attached patch expands the multi-part unit test suite to demonstrates t= he behavior described in this issue. =20 The patch also provides a potential fix for the issue.=20 Note that the solution recommended in the original issue description will n= ot work. That solution would cause parameters that are reused across multip= le web methods to be rejected with an error. =20 An alternative solution (as implemented in the patch) is as follows: 1. Change the behavior of the ServiceInterfaceStrategy to log a WARN messag= e in the case where a new QName mapping would override an existing mapping= . The new mapping will be ignored after the warning.=20 2. Move the QName + dataType uniqueness enforcement to the @WebMethod level The warning is an appropriate alternative to the current error. The Service= InterfaceStrategy.findQNameForSoapActionOrType(=E2=80=A6) operation _could_= return an unexpected value when a dataType is reused within the interface = with a different QName; however, this risk is fully mitigated when calling = findQNameForSoapActionOrType(=E2=80=A6) with a valid soapAction that unique= ly identifies the target @WebMethod on the service. At that point the Metho= dInfo class is queried for the type-to-QName mapping for the method, and th= e results will be as expected. =20 > RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, i= f there are parameters of the same type but with different QNames in Servic= eInterfaceStrategy > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------ > > Key: CAMEL-4480 > URL: https://issues.apache.org/jira/browse/CAMEL-4480 > Project: Camel > Issue Type: Bug > Components: camel-soap > Affects Versions: 2.8.1 > Reporter: Oliver Jelinski > Assignee: Rich Newcomb > Attachments: camel-4480-trunk.patch > > > In different WebMethods I have parameters of the same type, but with diff= erent QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeS= erviceInterface(..)) throws an exeption in these cases (thrown if NOT QName= OfMethod1 equals QNameOfMethod2), but it should on the contrary throw an ex= ception if the QNames ARE equal: > if (inTypeNameToQName.containsKey(ti.getTypeName()) > && (!(ti.getTypeName().equals("javax.xml.ws.Holder"))= ) > && (!(inTypeNameToQName.get(ti.getTypeName()).equals(= ti.getElName())))) { > throw new RuntimeCamelException("Ambiguous parameter = mapping. The type [ " > + ti.getTypeName() > + " ] is already mapp= ed to a QName in this context."); > } > The "NOT" must be deleted: > ... > && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName()))) > ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira