cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r783450 - in /cxf/trunk: common/ common/common/src/main/java/org/apache/cxf/staxutils/ common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap...
Date Wed, 10 Jun 2009 18:53:41 GMT
Author: bimargulies
Date: Wed Jun 10 18:53:37 2009
New Revision: 783450

URL: http://svn.apache.org/viewvc?rev=783450&view=rev
Log:
Merge, I guess.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/PartialXMLStreamReader.java
    cxf/trunk/common/pom.xml
    cxf/trunk/common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/WoodstoxValidationImpl.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    cxf/trunk/rt/databinding/aegis/pom.xml
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/PartialXMLStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/PartialXMLStreamReader.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/PartialXMLStreamReader.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/PartialXMLStreamReader.java
Wed Jun 10 18:53:37 2009
@@ -23,6 +23,11 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+/**
+ * Read from a StaX reader, stopping when the next element is a specified element.
+ * For example, this can be used to read all of the Header of a soap message into a DOM
+ * document stopping on contact with the body element.
+ */
 public class PartialXMLStreamReader extends DepthXMLStreamReader {
     private QName endTag;
     private boolean foundEnd;

Modified: cxf/trunk/common/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/common/pom.xml?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/common/pom.xml (original)
+++ cxf/trunk/common/pom.xml Wed Jun 10 18:53:37 2009
@@ -36,7 +36,7 @@
         <module>xsd</module>
         <module>schemas</module>
         <module>xjc</module>
-        <!--module>wstx-msv-validation</module-->
+        <module>wstx-msv-validation</module>
         <module>xerces-xsd-validation</module>
     </modules>
 

Modified: cxf/trunk/common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/WoodstoxValidationImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/WoodstoxValidationImpl.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/WoodstoxValidationImpl.java
(original)
+++ cxf/trunk/common/wstx-msv-validation/src/main/java/org/apache/cxf/wstx_msv_validation/WoodstoxValidationImpl.java
Wed Jun 10 18:53:37 2009
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.wstx_msv_validation;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.xml.stream.XMLStreamException;
@@ -26,6 +29,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.io.StaxValidationManager;
 import org.apache.cxf.service.model.ServiceInfo;
 
@@ -33,6 +37,7 @@
  * 
  */
 public class WoodstoxValidationImpl implements StaxValidationManager {
+    private static final Logger LOG = LogUtils.getL7dLogger(WoodstoxValidationImpl.class);
     
     private Bus bus;
     private Stax2ValidationUtils utils;
@@ -48,9 +53,10 @@
         try {
             utils = new Stax2ValidationUtils();
         } catch (Exception e) {
-            /* If the dependencies are missing ... */ 
+            LOG.log(Level.INFO, "Problem initializing MSV validation", e);
             return;
         } catch (NoSuchMethodError nsme) {
+            LOG.log(Level.INFO, "Problem initializing MSV validation", nsme);
             // these don't inherit from 'Exception'
             return;
         }
@@ -65,10 +71,14 @@
      * @throws XMLStreamException */
     public void setupValidation(XMLStreamReader reader, 
                                 ServiceInfo serviceInfo) throws XMLStreamException {
-        utils.setupValidation(reader, serviceInfo);
+        if (utils != null) {
+            utils.setupValidation(reader, serviceInfo);
+        }
     }
 
     public void setupValidation(XMLStreamWriter writer, ServiceInfo serviceInfo) throws XMLStreamException
{
-        utils.setupValidation(writer, serviceInfo);
+        if (utils != null) {
+            utils.setupValidation(writer, serviceInfo);
+        }
     }
 }

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Wed Jun 10 18:53:37 2009
@@ -53,6 +53,7 @@
 import org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapBodyInfo;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
@@ -383,6 +384,7 @@
         sb.getInInterceptors().add(new SoapHeaderInterceptor());
 
         sb.getInInterceptors().add(new ReadHeadersInterceptor(getBus()));
+        sb.getInInterceptors().add(new StartBodyInterceptor());
         sb.getInInterceptors().add(new CheckFaultInterceptor());
         sb.getInInterceptors().add(new MustUnderstandInterceptor());
         sb.getOutInterceptors().add(new SoapPreProtocolOutInterceptor());
@@ -787,6 +789,7 @@
             // processing. But, if you've disabled message processing, you
             // probably aren't going to use this feature.
             newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(getBus()));
+            newMO.getBindingInterceptors().add(new StartBodyInterceptor());
             newMO.getBindingInterceptors().add(new CheckFaultInterceptor());
 
             // Add in a default selection interceptor

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Wed Jun 10 18:53:37 2009
@@ -171,14 +171,6 @@
                         hel = DOMUtils.getNextElement(hel);
                     }
                 }
-                //advance to just outside the <soap:body> opening tag, but not 
-                //to the nextTag as that may skip over white space that is 
-                //important to keep for ws-security signature digests and stuff
-                int i = xmlReader.next();
-                while (i == XMLStreamReader.NAMESPACE
-                    || i == XMLStreamReader.ATTRIBUTE) {
-                    i = xmlReader.next();
-                }
             }
         } catch (XMLStreamException e) {
             throw new SoapFault(new Message("XML_STREAM_EXC", LOG), e, message.getVersion().getSender());

Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
Wed Jun 10 18:53:37 2009
@@ -36,6 +36,7 @@
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -52,6 +53,7 @@
     private MustUnderstandInterceptor mui;
     private DummySoapInterceptor dsi;
     private ReadHeadersInterceptor rhi;
+    private StartBodyInterceptor sbi;
 
     @Before
     public void setUp() throws Exception {
@@ -62,7 +64,10 @@
 
         rhi = new ReadHeadersInterceptor(bus, "phase1");
         chain.add(rhi);
-
+        
+        sbi = new StartBodyInterceptor("phase1.5");
+        chain.add(sbi);
+        
         mui = new MustUnderstandInterceptor("phase2");
         chain.add(mui);
 

Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
Wed Jun 10 18:53:37 2009
@@ -36,6 +36,7 @@
 import org.apache.cxf.attachment.AttachmentUtil;
 import org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.StaxInInterceptor;
@@ -47,6 +48,7 @@
 
     private ReadHeadersInterceptor rhi;
     private StaxInInterceptor staxIntc = new StaxInInterceptor();
+    private StartBodyInterceptor sbi;
 
     @Before
     public void setUp() throws Exception {
@@ -54,6 +56,8 @@
 
         rhi = new ReadHeadersInterceptor(BusFactory.getDefaultBus(), "phase1");
         chain.add(rhi);
+        sbi = new StartBodyInterceptor("phase1");
+        chain.add(sbi);
         chain.add(new CheckFaultInterceptor("phase2"));
     }
 

Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
Wed Jun 10 18:53:37 2009
@@ -31,6 +31,7 @@
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.junit.Before;
@@ -39,6 +40,7 @@
 public class SoapOutInterceptorTest extends TestBase {
     private ReadHeadersInterceptor rhi;
     private SoapOutInterceptor soi;
+    private StartBodyInterceptor sbi; 
 
     @Before
     public void setUp() throws Exception {
@@ -48,6 +50,8 @@
 
         rhi = new ReadHeadersInterceptor(BusFactory.getDefaultBus(), "phase2");
         chain.add(rhi);
+        sbi = new StartBodyInterceptor("phase1.5");
+        chain.add(sbi);
 
         soi = new SoapOutInterceptor(BusFactory.getDefaultBus(), "phase3");
         chain.add(soi);

Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
Wed Jun 10 18:53:37 2009
@@ -41,6 +41,7 @@
 import org.apache.cxf.binding.soap.TestUtil;
 import org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.junit.Before;
@@ -50,6 +51,7 @@
 public class SAAJInInterceptorTest extends TestBase {
 
     private ReadHeadersInterceptor rhi;
+    private StartBodyInterceptor sbi;
     private StaxInInterceptor staxIntc = new StaxInInterceptor();
     private SAAJInInterceptor saajIntc;
 
@@ -59,6 +61,8 @@
 
         rhi = new ReadHeadersInterceptor(BusFactory.getDefaultBus(), "phase1");
         chain.add(rhi);
+        sbi = new StartBodyInterceptor("phase1.5");
+        chain.add(sbi);
 
         saajIntc = new SAAJInInterceptor("phase2");
         chain.add(saajIntc);
@@ -76,6 +80,7 @@
 
         staxIntc.handleMessage(soapMessage);
         rhi.handleMessage(soapMessage);
+        sbi.handleMessage(soapMessage);
         saajIntc.handleMessage(soapMessage);
 
         // check the xmlReader should be placed on the first entry of the body
@@ -108,6 +113,7 @@
 
         staxIntc.handleMessage(soapMessage);
         rhi.handleMessage(soapMessage);
+        sbi.handleMessage(soapMessage);
 
         // check the xmlReader should be placed on the first entry of the body
         // element

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
Wed Jun 10 18:53:37 2009
@@ -48,7 +48,7 @@
 
     public void handleMessage(Message message) {
         if (isGET(message) && message.getContent(List.class) != null) {
-            LOG.fine("DocLiteralInInterceptor skipped in HTTP GET method");
+            LOG.fine("StaxDataBindingInterceptor skipped in HTTP GET method");
             return;
         }
         

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Wed Jun 10 18:53:37 2009
@@ -27,12 +27,10 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.validation.Schema;
 
 import org.w3c.dom.Node;
 
 import org.apache.cxf.common.i18n.BundleUtils;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
@@ -48,7 +46,6 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
-import org.apache.cxf.wsdl.EndpointReferenceUtils;
 
 public abstract class AbstractInDatabindingInterceptor extends AbstractPhaseInterceptor<Message>
{
     public static final String NO_VALIDATE_PARTS = AbstractInDatabindingInterceptor.class.getName()

@@ -89,9 +86,7 @@
         }
         dataReader.setAttachments(message.getAttachments());
         dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().get(Endpoint.class));
-        setSchemaInMessage(service, message, dataReader);
 
-        
         return dataReader;
     }
 
@@ -103,21 +98,6 @@
         return getDataReader(message, Node.class);
     }
 
-    private void setSchemaInMessage(Service service, Message message, DataReader<?>
reader) {
-        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
-        if (Boolean.TRUE.equals(en) || "true".equals(en)) {
-            //all serviceInfos have the same schemas
-            Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0));
-            reader.setSchema(schema);
-            /* This might be a reader that wants to grab the schema from the
-             * service info. 
-             */
-            if (reader instanceof DataBindingValidation2) {
-                ((DataBindingValidation2)reader).setValidationServiceModel(service.getServiceInfos().get(0));
-            }
-        }
-    }
-    
     protected DepthXMLStreamReader getXMLStreamReader(Message message) {
         XMLStreamReader xr = message.getContent(XMLStreamReader.class);
         if (xr instanceof DepthXMLStreamReader) {

Modified: cxf/trunk/rt/databinding/aegis/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/pom.xml?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/pom.xml (original)
+++ cxf/trunk/rt/databinding/aegis/pom.xml Wed Jun 10 18:53:37 2009
@@ -89,13 +89,12 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <!--dependency>
+        <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-wstx-msv-validation</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
-        </dependency-->
-
+        </dependency>
     </dependencies>
 
     <build>

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Wed Jun 10 18:53:37 2009
@@ -257,6 +257,8 @@
         aegisContext.setMappingNamespaceURI(s.getServiceInfos().get(0).getName().getNamespaceURI());
         aegisContext.initialize();
         this.service = s;
+        s.getInInterceptors().add(new AegisSchemaValidationInInterceptor(getBus(), 
+                                                                         s.getServiceInfos().get(0)));
 
         Set<Type> deps = new HashSet<Type>();
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
Wed Jun 10 18:53:37 2009
@@ -28,17 +28,15 @@
 
 import org.apache.cxf.aegis.AegisElementDataReader;
 import org.apache.cxf.aegis.type.Type;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 
 /**
  * 
  */
-public class ElementDataReader implements DataReader<Element>, DataBindingValidation2
{
+public class ElementDataReader implements DataReader<Element> {
     
     private AegisElementDataReader reader;
     private AegisDatabinding databinding;
@@ -93,7 +91,4 @@
     public void setSchema(Schema s) {
         reader.setSchema(s);
     }
-
-    public void setValidationServiceModel(ServiceInfo serviceInfo) {
-    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
Wed Jun 10 18:53:37 2009
@@ -36,15 +36,13 @@
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 
-public class ElementDataWriter implements DataWriter<Element>, DataBindingValidation2
{
+public class ElementDataWriter implements DataWriter<Element> {
 
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
 
@@ -113,7 +111,4 @@
         }
         return properties.get(key);
     }
-
-    public void setValidationServiceModel(ServiceInfo serviceInfo) {
-    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
Wed Jun 10 18:53:37 2009
@@ -27,24 +27,17 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.aegis.AegisXMLStreamDataReader;
 import org.apache.cxf.aegis.type.Type;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.io.StaxValidationManager;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 
-public class XMLStreamDataReader implements DataReader<XMLStreamReader>, DataBindingValidation2
{
+public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
 
     private AegisDatabinding databinding;
     private AegisXMLStreamDataReader reader;
-    private Bus bus;
-    private ServiceInfo serviceInfo;
-    private boolean validate;
     
     public XMLStreamDataReader(AegisDatabinding databinding, Bus bus) {
-        this.bus = bus;
         this.databinding = databinding;
         reader = new AegisXMLStreamDataReader(databinding.getAegisContext());
     }
@@ -52,12 +45,6 @@
     public Object read(MessagePartInfo part, XMLStreamReader input) {
         Type type = databinding.getType(part);
         try {
-            if (validate) {
-                StaxValidationManager mgr = bus.getExtension(StaxValidationManager.class);
-                if (mgr != null) {
-                    mgr.setupValidation(input, serviceInfo);
-                }
-            }
             return reader.read(input, type); 
         } catch (Exception e) {
             throw new Fault(e);
@@ -87,9 +74,4 @@
     public void setSchema(Schema s) {
         reader.setSchema(s);
     }
-
-    public void setValidationServiceModel(ServiceInfo serviceModel) {
-        serviceInfo = serviceModel;
-        validate = true;
-    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
Wed Jun 10 18:53:37 2009
@@ -23,7 +23,6 @@
 import java.util.Map;
 import java.util.logging.Logger;
 
-import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.validation.Schema;
 
@@ -36,28 +35,22 @@
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.io.StaxValidationManager;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 
-public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter>, DataBindingValidation2
{
+public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> {
 
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
 
     private AegisDatabinding databinding;
     private Collection<Attachment> attachments;
     private Map<String, Object> properties;
-    private ServiceInfo validationServiceInfo;
-    private Bus bus;
     
     public XMLStreamDataWriter(AegisDatabinding databinding, Bus bus) {
         this.databinding = databinding;
-        this.bus = bus;
     }
 
     public void setAttachments(Collection<Attachment> attachments) {
@@ -74,17 +67,6 @@
             throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG, part));
         }
         
-        if (validationServiceInfo != null) {
-            StaxValidationManager mgr = bus.getExtension(StaxValidationManager.class);
-            if (mgr != null) {
-                try {
-                    mgr.setupValidation(output, validationServiceInfo);
-                } catch (XMLStreamException e) {
-                    throw new Fault(e);
-                }
-            }
-        }
-        
         Context context = new Context(databinding.getAegisContext());
         
         context.setAttachments(attachments);
@@ -132,8 +114,4 @@
         }
         return properties.get(key);
     }
-
-    public void setValidationServiceModel(ServiceInfo serviceInfo) {
-        validationServiceInfo = serviceInfo;
-    }
 }

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
Wed Jun 10 18:53:37 2009
@@ -30,19 +30,17 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 
 
-public class DataReaderImpl implements DataReader<XMLStreamReader> , DataBindingValidation2
{
+public class DataReaderImpl implements DataReader<XMLStreamReader> {
     private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
     private boolean validate;
     
@@ -142,8 +140,4 @@
 
     public void setSchema(Schema s) {
     }
-
-    public void setValidationServiceModel(ServiceInfo serviceModel) {
-        validate = true;
-    }
 }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java?rev=783450&r1=783449&r2=783450&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
(original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
Wed Jun 10 18:53:37 2009
@@ -39,6 +39,7 @@
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
+import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.ExchangeImpl;
@@ -411,6 +412,8 @@
         soapMessage.setContent(XMLStreamReader.class, reader);
         ReadHeadersInterceptor rji = new ReadHeadersInterceptor(BusFactory.getDefaultBus());
         rji.handleMessage(soapMessage); 
+        StartBodyInterceptor sbi = new StartBodyInterceptor();
+        sbi.handleMessage(soapMessage);
         return soapMessage;
     }
 }



Mime
View raw message