Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EABB4DFF7 for ; Sun, 12 Aug 2012 14:30:00 +0000 (UTC) Received: (qmail 65133 invoked by uid 500); 12 Aug 2012 14:30:00 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 65088 invoked by uid 500); 12 Aug 2012 14:30:00 -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 65080 invoked by uid 99); 12 Aug 2012 14:30:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Aug 2012 14:30:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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; Sun, 12 Aug 2012 14:29:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D1A4E23889E2; Sun, 12 Aug 2012 14:29:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1372114 - /cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Date: Sun, 12 Aug 2012 14:29:16 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120812142916.D1A4E23889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Sun Aug 12 14:29:16 2012 New Revision: 1372114 URL: http://svn.apache.org/viewvc?rev=1372114&view=rev Log: Merged revisions 1372106 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ........ r1372106 | dkulp | 2012-08-12 10:27:05 -0400 (Sun, 12 Aug 2012) | 18 lines Merged revisions 1372096 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes ........ r1372096 | dkulp | 2012-08-12 10:10:55 -0400 (Sun, 12 Aug 2012) | 10 lines Merged revisions 1371858 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1371858 | dkulp | 2012-08-10 22:48:34 -0400 (Fri, 10 Aug 2012) | 2 lines Check the flag on the Service as well ........ ........ ........ Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=1372114&r1=1372113&r2=1372114&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Sun Aug 12 14:29:16 2012 @@ -36,6 +36,7 @@ import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageContentsList; import org.apache.cxf.phase.Phase; +import org.apache.cxf.service.Service; import org.apache.cxf.service.model.BindingMessageInfo; import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.MessageInfo; @@ -195,8 +196,8 @@ public class DocLiteralInInterceptor ext //Make sure the elName found on the wire is actually OK for //the purpose we need it - validatePart(p, elName, si); - + validatePart(p, elName, si, ep.getService()); + o = dr.read(p, xmlReader); if (Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare")) && parameters.isEmpty()) { @@ -223,14 +224,14 @@ public class DocLiteralInInterceptor ext } } - private void validatePart(MessagePartInfo p, QName elName, ServiceInfo si) { + private void validatePart(MessagePartInfo p, QName elName, ServiceInfo si, Service service) { if (p == null) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", LOG, elName), Fault.FAULT_CODE_CLIENT); } - Boolean synth = Boolean.FALSE; + boolean synth = false; if (p.getMessageInfo() != null && p.getMessageInfo().getOperation() != null) { OperationInfo op = p.getMessageInfo().getOperation(); Boolean b = (Boolean)op.getProperty("operation.is.synthetic"); @@ -238,7 +239,8 @@ public class DocLiteralInInterceptor ext synth = b; } } - if (si != null && Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare"))) { + if ((si != null && Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare"))) + || (service != null && Boolean.TRUE.equals(service.get("soap.force.doclit.bare")))) { // something like a Provider service or similar that is forcing a // doc/lit/bare on an endpoint that may not really be doc/lit/bare. // we need to just let these through per spec so the endpoint @@ -248,13 +250,13 @@ public class DocLiteralInInterceptor ext if (p.isElement()) { if (p.getConcreteName() != null && !elName.equals(p.getConcreteName()) - && !Boolean.TRUE.equals(synth)) { + && !synth) { throw new Fault("UNEXPECTED_ELEMENT", LOG, null, elName, p.getConcreteName()); } } else { if (!(elName.equals(p.getName()) || elName.equals(p.getConcreteName())) - && !Boolean.TRUE.equals(synth)) { + && !synth) { throw new Fault("UNEXPECTED_ELEMENT", LOG, null, elName, p.getConcreteName()); }