Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 78468 invoked from network); 21 Dec 2009 20:08:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 20:08:41 -0000 Received: (qmail 3806 invoked by uid 500); 21 Dec 2009 20:08:41 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 3741 invoked by uid 500); 21 Dec 2009 20:08:40 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 3732 invoked by uid 99); 21 Dec 2009 20:08:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 20:08:40 +0000 X-ASF-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 20:08:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D5EA823889FA; Mon, 21 Dec 2009 20:08:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r892955 - in /cxf/branches/2.2.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Date: Mon, 21 Dec 2009 20:08:13 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091221200813.D5EA823889FA@eris.apache.org> Author: dkulp Date: Mon Dec 21 20:08:13 2009 New Revision: 892955 URL: http://svn.apache.org/viewvc?rev=892955&view=rev Log: Merged revisions 892953 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r892953 | dkulp | 2009-12-21 15:05:07 -0500 (Mon, 21 Dec 2009) | 2 lines [CXF-2587] Workaround "bug" in wsdl4j that really isn't looking into imports like the docs say. ........ Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Dec 21 20:08:13 2009 @@ -1 +1 @@ -/cxf/trunk:891375-891393,891452,891817,891827,891859,891945-891946,892056,892307,892360,892664,892890,892920 +/cxf/trunk:891375-891393,891452,891817,891827,891859,891945-891946,892056,892307,892360,892664,892890,892920,892953 Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=892955&r1=892954&r2=892955&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Mon Dec 21 20:08:13 2009 @@ -27,6 +27,7 @@ import javax.wsdl.BindingInput; import javax.wsdl.BindingOutput; import javax.wsdl.Definition; +import javax.wsdl.Import; import javax.wsdl.Part; import javax.wsdl.WSDLException; import javax.wsdl.extensions.ExtensibilityElement; @@ -61,6 +62,7 @@ import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.common.xmlschema.SchemaCollection; import org.apache.cxf.endpoint.Endpoint; +import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.AttachmentInInterceptor; import org.apache.cxf.interceptor.AttachmentOutInterceptor; import org.apache.cxf.interceptor.BareOutInterceptor; @@ -416,16 +418,52 @@ SchemaCollection schemas = serviceInfo.getXmlSchemaCollection(); if (def != null && schemas != null) { - javax.wsdl.Message msg = def.getMessage(header.getMessage()); + QName qn = header.getMessage(); + + javax.wsdl.Message msg = findMessage(qn, def); if (msg != null) { addOutOfBandParts(bop, msg, schemas, isInput, header.getPart()); serviceInfo.refresh(); } else { throw new RuntimeException("Problem with WSDL: soap:header element" - + " is referring to an undefined wsdl:message element."); + + " for operation " + bop.getName() + + " is referring to an undefined wsdl:message element: " + qn); + } + } + } + } + private javax.wsdl.Message findMessage(QName qn, Definition def) { + javax.wsdl.Message msg = def.getMessage(qn); + if (msg == null) { + msg = findMessage(qn, def, new ArrayList()); + } + return msg; + } + private javax.wsdl.Message findMessage(QName qn, Definition def, List done) { + javax.wsdl.Message msg = def.getMessage(qn); + if (msg == null) { + if (done.contains(def)) { + return null; + } + done.add(def); + Collection> ilist = CastUtils.cast(def.getImports().values()); + for (List list : ilist) { + for (Import i : list) { + if (qn.getNamespaceURI().equals(i.getDefinition().getTargetNamespace())) { + return i.getDefinition().getMessage(qn); + } + } + } + for (List list : ilist) { + for (Import i : list) { + msg = findMessage(qn, i.getDefinition(), done); + if (msg != null) { + return msg; + } } } } + return msg; } private void addOutOfBandParts(final BindingOperationInfo bop, final javax.wsdl.Message msg,