You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/07/09 15:41:58 UTC

svn commit: r1501258 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/ systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/ systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/pa...

Author: coheigea
Date: Tue Jul  9 13:41:58 2013
New Revision: 1501258

URL: http://svn.apache.org/r1501258
Log:
More streaming security tests

Added:
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java
      - copied, changed from r1501257, cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxServer.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/stax-server.xml
Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java?rev=1501258&r1=1501257&r2=1501258&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java Tue Jul  9 13:41:58 2013
@@ -952,7 +952,7 @@ public abstract class AbstractStaxBindin
             }
             for (Header head : parts.getHeaders()) {
                 QName qname = new QName(head.getNamespace(), head.getName());
-                SecurePart securePart = new SecurePart(qname, Modifier.Content);
+                SecurePart securePart = new SecurePart(qname, Modifier.Element);
                 securePart.setRequired(false);
                 encryptedParts.add(securePart);
             }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java?rev=1501258&r1=1501257&r2=1501258&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java Tue Jul  9 13:41:58 2013
@@ -34,7 +34,8 @@ import org.example.contract.doubleit.Dou
 import org.junit.BeforeClass;
 
 /**
- * This is a test for various Required/Signed/Encrypted Parts/Elements
+ * This is a test for various Required/Signed/Encrypted Parts/Elements. It tests both DOM + StAX 
+ * clients against the DOM server
  */
 public class PartsTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(Server.class);
@@ -75,6 +76,12 @@ public class PartsTest extends AbstractB
         QName portQName = new QName(NAMESPACE, "DoubleItRequiredPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
         // This should fail, as the service requires a (bad) header
@@ -82,6 +89,7 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a required header which isn't present");
@@ -89,6 +97,16 @@ public class PartsTest extends AbstractB
             String error = "RequiredParts: No header element";
             assertTrue(ex.getMessage().contains(error));
         }
+
+        // Streaming
+        try {
+            SecurityTestUtil.enableStreaming(port);
+            port.doubleIt(25);
+            fail("Failure expected on a required header which isn't present");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "RequiredParts: No header element";
+            // assertTrue(ex.getMessage().contains(error));
+        }
         
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
@@ -147,6 +165,12 @@ public class PartsTest extends AbstractB
         QName portQName = new QName(NAMESPACE, "DoubleItSignedPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
         // This should fail, as the service requires that the Body must be signed
@@ -154,6 +178,7 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a body which isn't signed");
@@ -162,11 +187,22 @@ public class PartsTest extends AbstractB
             assertTrue(ex.getMessage().contains(error));
         }
         
+        // Streaming
+        try {
+            SecurityTestUtil.enableStreaming(port);
+            port.doubleIt(25);
+            fail("Failure expected on a body which isn't signed");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
+        }
+        
         // This should fail, as the service requires that the To header must be signed
         portQName = new QName(NAMESPACE, "DoubleItSignedPartsPort3");
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a header which isn't signed");
@@ -175,6 +211,16 @@ public class PartsTest extends AbstractB
             assertTrue(ex.getMessage().contains(error));
         }
         
+        // Streaming
+        try {
+            SecurityTestUtil.enableStreaming(port);
+            port.doubleIt(25);
+            fail("Failure expected on a body which isn't signed");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
+        }
+        
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
@@ -232,6 +278,12 @@ public class PartsTest extends AbstractB
         QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
         // This should fail, as the service requires that the Body must be encrypted
@@ -239,6 +291,7 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a body which isn't encrypted");
@@ -247,11 +300,22 @@ public class PartsTest extends AbstractB
             assertTrue(ex.getMessage().contains(error));
         }
         
+        // Streaming
+        try {
+            SecurityTestUtil.enableStreaming(port);
+            port.doubleIt(25);
+            fail("Failure expected on a body which isn't encrypted");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "EncryptedParts";
+            // assertTrue(ex.getMessage().contains(error));
+        }
+        
         // This should fail, as the service requires that the To header must be encrypted
         portQName = new QName(NAMESPACE, "DoubleItEncryptedPartsPort3");
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a header which isn't encrypted");
@@ -260,6 +324,16 @@ public class PartsTest extends AbstractB
             assertTrue(ex.getMessage().contains(error));
         }
         
+        // Streaming
+        try {
+            SecurityTestUtil.enableStreaming(port);
+            port.doubleIt(25);
+            fail("Failure expected on a header which isn't encrypted");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "EncryptedParts";
+            // assertTrue(ex.getMessage().contains(error));
+        }
+        
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }

Copied: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java (from r1501257, cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java?p2=cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java&p1=cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java&r1=1501257&r2=1501258&rev=1501258&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java Tue Jul  9 13:41:58 2013
@@ -34,10 +34,11 @@ import org.example.contract.doubleit.Dou
 import org.junit.BeforeClass;
 
 /**
- * This is a test for various Required/Signed/Encrypted Parts/Elements
+ * This is a test for various Required/Signed/Encrypted Parts/Elements. It tests both DOM + StAX 
+ * clients against the StAX server
  */
-public class PartsTest extends AbstractBusClientServerTestBase {
-    static final String PORT = allocatePort(Server.class);
+public class StaxPartsTest extends AbstractBusClientServerTestBase {
+    static final String PORT = allocatePort(StaxServer.class);
     
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
@@ -48,7 +49,7 @@ public class PartsTest extends AbstractB
             "Server failed to launch",
             // run the server in the same process
             // set this to false to fork
-            launchServer(Server.class, true)
+            launchServer(StaxServer.class, true)
         );
     }
     
@@ -62,70 +63,53 @@ public class PartsTest extends AbstractB
     public void testRequiredParts() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
+        URL busFile = StaxPartsTest.class.getResource("client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
         SpringBusFactory.setDefaultBus(bus);
         SpringBusFactory.setThreadDefaultBus(bus);
 
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
+        URL wsdl = StaxPartsTest.class.getResource("DoubleItParts.wsdl");
         Service service = Service.create(wsdl, SERVICE_QNAME);
        
         // Successful invocation
         QName portQName = new QName(NAMESPACE, "DoubleItRequiredPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
+        /*
+         * TODO WSS-459
         // This should fail, as the service requires a (bad) header
         portQName = new QName(NAMESPACE, "DoubleItRequiredPartsPort2");
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a required header which isn't present");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "RequiredParts: No header element";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "RequiredParts: No header element";
+            // assertTrue(ex.getMessage().contains(error));
         }
-        
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
-    }
-    
-    @org.junit.Test
-    public void testRequiredElements() throws Exception {
-
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        SpringBusFactory.setDefaultBus(bus);
-        SpringBusFactory.setThreadDefaultBus(bus);
 
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-       
-        // Successful invocation
-        QName portQName = new QName(NAMESPACE, "DoubleItRequiredElementsPort");
-        DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        port.doubleIt(25);
-        
-        // This should fail, as the service requires a (bad) header
-        portQName = new QName(NAMESPACE, "DoubleItRequiredElementsPort2");
-        port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        
+        // Streaming
         try {
+            SecurityTestUtil.enableStreaming(port);
             port.doubleIt(25);
             fail("Failure expected on a required header which isn't present");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "RequiredElements: No header element";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "RequiredParts: No header element";
+            // assertTrue(ex.getMessage().contains(error));
         }
-        
+        */
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
@@ -134,19 +118,25 @@ public class PartsTest extends AbstractB
     public void testSignedParts() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
+        URL busFile = StaxPartsTest.class.getResource("client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
         SpringBusFactory.setDefaultBus(bus);
         SpringBusFactory.setThreadDefaultBus(bus);
 
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
+        URL wsdl = StaxPartsTest.class.getResource("DoubleItParts.wsdl");
         Service service = Service.create(wsdl, SERVICE_QNAME);
        
         // Successful invocation
         QName portQName = new QName(NAMESPACE, "DoubleItSignedPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
         // This should fail, as the service requires that the Body must be signed
@@ -154,12 +144,23 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
+        try {
+            port.doubleIt(25);
+            fail("Failure expected on a body which isn't signed");
+        } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
+        }
+        
+        // Streaming
         try {
+            SecurityTestUtil.enableStreaming(port);
             port.doubleIt(25);
             fail("Failure expected on a body which isn't signed");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "SignedParts";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
         
         // This should fail, as the service requires that the To header must be signed
@@ -167,48 +168,23 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a header which isn't signed");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "SignedParts";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
         
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
-    }
-    
-    @org.junit.Test
-    public void testSignedElements() throws Exception {
-
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        SpringBusFactory.setDefaultBus(bus);
-        SpringBusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-       
-        // Successful invocation
-        QName portQName = new QName(NAMESPACE, "DoubleItSignedElementsPort");
-        DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        port.doubleIt(25);
-        
-        // This should fail, as the service requires that the To header must be signed
-        portQName = new QName(NAMESPACE, "DoubleItSignedElementsPort2");
-        port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        
+        // Streaming
         try {
+            SecurityTestUtil.enableStreaming(port);
             port.doubleIt(25);
-            fail("Failure expected on a header which isn't signed");
+            fail("Failure expected on a body which isn't signed");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "SignedElements";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "SignedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
         
         ((java.io.Closeable)port).close();
@@ -219,19 +195,25 @@ public class PartsTest extends AbstractB
     public void testEncryptedParts() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
+        URL busFile = StaxPartsTest.class.getResource("client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
         SpringBusFactory.setDefaultBus(bus);
         SpringBusFactory.setThreadDefaultBus(bus);
 
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
+        URL wsdl = StaxPartsTest.class.getResource("DoubleItParts.wsdl");
         Service service = Service.create(wsdl, SERVICE_QNAME);
        
         // Successful invocation
         QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPartsPort");
         DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
+        
+        // DOM
+        port.doubleIt(25);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
         port.doubleIt(25);
         
         // This should fail, as the service requires that the Body must be encrypted
@@ -239,101 +221,54 @@ public class PartsTest extends AbstractB
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        /*
+         * TODO WSS-459
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a body which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "EncryptedParts";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "EncryptedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
         
-        // This should fail, as the service requires that the To header must be encrypted
-        portQName = new QName(NAMESPACE, "DoubleItEncryptedPartsPort3");
-        port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        
+        // Streaming
         try {
+            SecurityTestUtil.enableStreaming(port);
             port.doubleIt(25);
-            fail("Failure expected on a header which isn't encrypted");
+            fail("Failure expected on a body which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "EncryptedParts";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "EncryptedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
         
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
-    }
-    
-    @org.junit.Test
-    public void testEncryptedElements() throws Exception {
-
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        SpringBusFactory.setDefaultBus(bus);
-        SpringBusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-       
-        // Successful invocation
-        QName portQName = new QName(NAMESPACE, "DoubleItEncryptedElementsPort");
-        DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        port.doubleIt(25);
-        
-        // This should fail, as the service requires that the header must be encrypted
-        portQName = new QName(NAMESPACE, "DoubleItEncryptedElementsPort2");
+        // This should fail, as the service requires that the To header must be encrypted
+        portQName = new QName(NAMESPACE, "DoubleItEncryptedPartsPort3");
         port = service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
         
+        // DOM
         try {
             port.doubleIt(25);
             fail("Failure expected on a header which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "EncryptedElements";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "EncryptedParts";
+            // (ex.getMessage().contains(error));
         }
         
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
-    }
-    
-    @org.junit.Test
-    public void testContentEncryptedElements() throws Exception {
-
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = PartsTest.class.getResource("client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        SpringBusFactory.setDefaultBus(bus);
-        SpringBusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = PartsTest.class.getResource("DoubleItParts.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-       
-        // Successful invocation
-        QName portQName = new QName(NAMESPACE, "DoubleItContentEncryptedElementsPort");
-        DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        port.doubleIt(25);
-        
-        // This should fail, as the service requires that the header must be encrypted
-        portQName = new QName(NAMESPACE, "DoubleItContentEncryptedElementsPort2");
-        port = service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        
+        // Streaming
         try {
+            SecurityTestUtil.enableStreaming(port);
             port.doubleIt(25);
             fail("Failure expected on a header which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            String error = "EncryptedElements";
-            assertTrue(ex.getMessage().contains(error));
+            // String error = "EncryptedParts";
+            // assertTrue(ex.getMessage().contains(error));
         }
+        */
         
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
-  
+    
 }

Added: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxServer.java?rev=1501258&view=auto
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxServer.java (added)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxServer.java Tue Jul  9 13:41:58 2013
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.parts;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class StaxServer extends AbstractBusTestServerBase {
+
+    public StaxServer() {
+
+    }
+
+    protected void run()  {
+        URL busFile = StaxServer.class.getResource("stax-server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new StaxServer();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Added: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/stax-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/stax-server.xml?rev=1501258&view=auto
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/stax-server.xml (added)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/stax-server.xml Tue Jul  9 13:41:58 2013
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:http="http://cxf.apache.org/transports/http/configuration"
+    xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+    xmlns:sec="http://cxf.apache.org/configuration/security"
+    xmlns:cxf="http://cxf.apache.org/core"
+    xmlns:p="http://cxf.apache.org/policy"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd
+        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+        http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+        http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd
+        http://cxf.apache.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+        http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd
+        http://www.w3.org/ns/ws-policy                                  http://www.w3.org/2007/02/ws-policy.xsd
+    ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    <jaxws:endpoint id="RequiredParts"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItRequiredParts"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItRequiredPartsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/req-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="RequiredParts2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItRequiredParts2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItRequiredPartsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="RequiredElements"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItRequiredElements"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItRequiredElementsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/req-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="RequiredElements2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItRequiredElements2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItRequiredElementsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="SignedParts"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItSignedParts"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItSignedPartsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/signed-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="SignedParts2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItSignedParts2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItSignedPartsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/signed-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="SignedParts3"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItSignedParts3"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItSignedPartsPort3"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/signed-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="SignedElements"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItSignedElements"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItSignedElementsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/signed-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="SignedElements2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItSignedElements2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItSignedElementsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="useReqSigCert" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/signed-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="EncryptedParts"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItEncryptedParts"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedPartsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="EncryptedParts2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItEncryptedParts2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedPartsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="EncryptedParts3"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItEncryptedParts3"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedPartsPort3"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="EncryptedElements"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItEncryptedElements"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedElementsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="EncryptedElements2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItEncryptedElements2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedElementsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="ContentEncryptedElements"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItContentEncryptedElements"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItContentEncryptedElementsPort"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+    <jaxws:endpoint id="ContentEncryptedElements2"
+        address="http://localhost:${testutil.ports.StaxServer}/DoubleItContentEncryptedElements2"
+        serviceName="s:DoubleItService" endpointName="s:DoubleItContentEncryptedElementsPort2"
+        xmlns:s="http://www.example.org/contract/DoubleIt" 
+        implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+        wsdlLocation="org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl">
+
+        <jaxws:properties>
+            <entry key="ws-security.callback-handler"
+                value="org.apache.cxf.systest.ws.common.UTPasswordCallback" />
+            <entry key="ws-security.signature.properties" value="bob.properties" />
+            <entry key="ws-security.encryption.username" value="alice" />
+            <entry key="ws-security.encryption.properties" value="alice.properties" />
+            <entry key="ws-security.subject.cert.constraints" value=".*O=apache.org.*"/>
+            <entry key="ws-security.enable.streaming" value="true"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" 
+                    URI="classpath:/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml" />
+            </p:policies>
+        </jaxws:features>
+
+    </jaxws:endpoint>
+    
+</beans>