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()); }
