You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/08/13 16:06:17 UTC

svn commit: r1372428 - /cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java

Author: dkulp
Date: Mon Aug 13 14:06:17 2012
New Revision: 1372428

URL: http://svn.apache.org/viewvc?rev=1372428&view=rev
Log:
Use a contextual property check.  Slightly faster and provides broader ability to set it.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=1372428&r1=1372427&r2=1372428&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Mon Aug 13 14:06:17 2012
@@ -35,8 +35,8 @@ import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageContentsList;
+import org.apache.cxf.message.MessageUtils;
 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,10 +195,10 @@ 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, ep.getService());
+                    validatePart(p, elName, message);
              
                     o = dr.read(p, xmlReader);
-                    if (Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare")) 
+                    if (MessageUtils.getContextualBoolean(message, "soap.force.doclit.bare", false) 
                         && parameters.isEmpty()) {
                         // webservice provider does not need to ensure size
                         parameters.add(o);
@@ -223,7 +223,7 @@ public class DocLiteralInInterceptor ext
         }
     }
     
-    private void validatePart(MessagePartInfo p, QName elName, ServiceInfo si, Service service) {
+    private void validatePart(MessagePartInfo p, QName elName, Message m) {
         if (p == null) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", LOG, elName),
                             Fault.FAULT_CODE_CLIENT);
@@ -238,8 +238,8 @@ public class DocLiteralInInterceptor ext
                 synth = b;
             }
         }
-        if ((si != null && Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare")))
-             || (service != null && Boolean.TRUE.equals(service.get("soap.force.doclit.bare")))) {
+        
+        if (MessageUtils.getContextualBoolean(m, "soap.force.doclit.bare", false)) {
             // 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