Author: coheigea
Date: Fri Nov 15 14:37:43 2013
New Revision: 1542275
URL: http://svn.apache.org/r1542275
Log:
Adding @Ignore'd tests for SwA negative tests
Added:
cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/DoubleIt3Impl.java
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-attachments-policy.xml
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/signed-attachments-policy.xml
Modified:
cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/PartsTest.java
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/client.xml
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/server.xml
Added:
cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/DoubleIt3Impl.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/DoubleIt3Impl.java?rev=1542275&view=auto
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/DoubleIt3Impl.java
(added)
+++
cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/DoubleIt3Impl.java
Fri Nov 15 14:37:43 2013
@@ -0,0 +1,53 @@
+/**
+ * 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.util.Arrays;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.feature.Features;
+import org.example.contract.doubleit.DoubleItFault;
+import org.example.contract.doubleit.DoubleItSwaPortType;
+import org.example.schema.doubleit.DoubleIt3;
+import org.example.schema.doubleit.DoubleItResponse;
+
+@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt",
+ serviceName = "DoubleItService",
+ endpointInterface =
"org.example.contract.doubleit.DoubleItSwaPortType")
+@Features(features = "org.apache.cxf.feature.LoggingFeature")
+public class DoubleIt3Impl implements DoubleItSwaPortType {
+
+ @Override
+ public DoubleItResponse doubleIt3(DoubleIt3 parameters, byte[] attachment)
throws DoubleItFault {
+ int numberToDouble = parameters.getNumberToDouble();
+ if (numberToDouble == 0) {
+ throw new DoubleItFault("0 can't be doubled!");
+ }
+
+ if (!Arrays.equals(attachment, "12345".getBytes())) {
+ throw new DoubleItFault("Unexpected attachment value!");
+ }
+
+ DoubleItResponse response = new DoubleItResponse();
+ response.setDoubledNumber(numberToDouble * 2);
+ return response;
+ }
+
+}
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=1542275&r1=1542274&r2=1542275&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
Fri Nov 15 14:37:43 2013
@@ -28,9 +28,9 @@ import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.systest.ws.common.SecurityTestUtil;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
import org.example.contract.doubleit.DoubleItPortType;
-
+import org.example.contract.doubleit.DoubleItSwaPortType;
+import org.example.schema.doubleit.DoubleIt3;
import org.junit.BeforeClass;
/**
@@ -459,5 +459,125 @@ public class PartsTest extends AbstractB
((java.io.Closeable)port).close();
bus.shutdown(true);
}
+
+ // TODO - re-enable once we move off WSS4J 2.0-beta
+ @org.junit.Test
+ @org.junit.Ignore
+ public void testSignedAttachments() 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,
"DoubleItSignedAttachmentsPort");
+ DoubleItSwaPortType port = service.getPort(portQName,
DoubleItSwaPortType.class);
+ updateAddressPort(port, PORT);
+
+ // DOM
+ DoubleIt3 doubleIt = new DoubleIt3();
+ doubleIt.setNumberToDouble(25);
+ port.doubleIt3(doubleIt, "12345".getBytes());
+
+ // Streaming
+ // SecurityTestUtil.enableStreaming(port);
+ // port.doubleIt(25);
+
+ // This should fail, as the service requires that the Attachments must
be signed
+ portQName = new QName(NAMESPACE, "DoubleItSignedAttachmentsPort2");
+ port = service.getPort(portQName, DoubleItSwaPortType.class);
+ updateAddressPort(port, PORT);
+
+ // DOM
+ try {
+ doubleIt = new DoubleIt3();
+ doubleIt.setNumberToDouble(25);
+ port.doubleIt3(doubleIt, "12345".getBytes());
+ fail("Failure expected on an attachment 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));
+ }
+ */
+
+ ((java.io.Closeable)port).close();
+ bus.shutdown(true);
+ }
+
+ // TODO - re-enable once we move off WSS4J 2.0-beta
+ @org.junit.Test
+ @org.junit.Ignore
+ public void testEncryptedAttachments() 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,
"DoubleItEncryptedAttachmentsPort");
+ DoubleItSwaPortType port = service.getPort(portQName,
DoubleItSwaPortType.class);
+ updateAddressPort(port, PORT);
+
+ // DOM
+ DoubleIt3 doubleIt = new DoubleIt3();
+ doubleIt.setNumberToDouble(25);
+ port.doubleIt3(doubleIt, "12345".getBytes());
+
+ // Streaming
+ // SecurityTestUtil.enableStreaming(port);
+ // port.doubleIt(25);
+
+ // This should fail, as the service requires that the Attachments must
be encrypted
+ portQName = new QName(NAMESPACE, "DoubleItEncryptedAttachmentsPort2");
+ port = service.getPort(portQName, DoubleItSwaPortType.class);
+ updateAddressPort(port, PORT);
+
+ // DOM
+ try {
+ doubleIt = new DoubleIt3();
+ doubleIt.setNumberToDouble(25);
+ port.doubleIt3(doubleIt, "12345".getBytes());
+ fail("Failure expected on an attachment which isn't encrypted");
+ } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+ String error = "EncryptedParts";
+ 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);
+ }
}
Modified:
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl?rev=1542275&r1=1542274&r2=1542275&view=diff
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl
(original)
+++
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/DoubleItParts.wsdl
Fri Nov 15 14:37:43 2013
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/contract/DoubleIt"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsaws="http://www.w3.org/2005/08/addressing"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802"
name="DoubleIt" targetNamespace="http://www.example.org/contract/DoubleIt">
+<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/contract/DoubleIt"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsaws="http://www.w3.org/2005/08/addressing"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" name="DoubleIt"
targetNamespace="http://www.example.org/contract/DoubleIt">
<wsdl:import location="src/test/resources/DoubleItLogical.wsdl"
namespace="http://www.example.org/contract/DoubleIt"/>
<wsdl:binding name="DoubleItStandardBinding" type="tns:DoubleItPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -34,6 +34,29 @@
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
+ <wsdl:binding name="DoubleItAttachmentBinding"
type="tns:DoubleItSwaPortType">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="DoubleIt3">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attachment" type="image/jpeg"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="DoubleItFault">
+ <soap:body use="literal" name="DoubleItFault"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
<wsdl:service name="DoubleItService">
<wsdl:port name="DoubleItRequiredPartsPort"
binding="tns:DoubleItStandardBinding">
<soap:address
location="http://localhost:9010/DoubleItRequiredParts"/>
@@ -83,5 +106,18 @@
<wsdl:port name="DoubleItContentEncryptedElementsPort2"
binding="tns:DoubleItStandardBinding">
<soap:address
location="http://localhost:9010/DoubleItContentEncryptedElements2"/>
</wsdl:port>
+
+ <wsdl:port name="DoubleItSignedAttachmentsPort"
binding="tns:DoubleItAttachmentBinding">
+ <soap:address
location="http://localhost:9010/DoubleItSignedAttachments"/>
+ </wsdl:port>
+ <wsdl:port name="DoubleItSignedAttachmentsPort2"
binding="tns:DoubleItAttachmentBinding">
+ <soap:address
location="http://localhost:9010/DoubleItSignedAttachments2"/>
+ </wsdl:port>
+ <wsdl:port name="DoubleItEncryptedAttachmentsPort"
binding="tns:DoubleItAttachmentBinding">
+ <soap:address
location="http://localhost:9010/DoubleItEncryptedAttachments"/>
+ </wsdl:port>
+ <wsdl:port name="DoubleItEncryptedAttachmentsPort2"
binding="tns:DoubleItAttachmentBinding">
+ <soap:address
location="http://localhost:9010/DoubleItEncryptedAttachments2"/>
+ </wsdl:port>
</wsdl:service>
</wsdl:definitions>
Modified:
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/client.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/client.xml?rev=1542275&r1=1542274&r2=1542275&view=diff
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/client.xml
(original)
+++
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/client.xml
Fri Nov 15 14:37:43 2013
@@ -264,4 +264,70 @@
</p:policies>
</jaxws:features>
</jaxws:client>
+
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItSignedAttachmentsPort"
createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="Alice"/>
+ <entry key="ws-security.callback-handler"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ <entry key="ws-security.encryption.properties"
value="bob.properties"/>
+ <entry key="ws-security.encryption.username" value="bob"/>
+ <entry key="ws-security.signature.properties"
value="alice.properties"/>
+ <entry key="ws-security.signature.username" value="alice"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItSignedAttachmentsPort2"
createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="Alice"/>
+ <entry key="ws-security.callback-handler"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ <entry key="ws-security.encryption.properties"
value="bob.properties"/>
+ <entry key="ws-security.encryption.username" value="bob"/>
+ <entry key="ws-security.signature.properties"
value="alice.properties"/>
+ <entry key="ws-security.signature.username" value="alice"/>
+ </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-body-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedAttachmentsPort"
createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="Alice"/>
+ <entry key="ws-security.callback-handler"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ <entry key="ws-security.encryption.properties"
value="bob.properties"/>
+ <entry key="ws-security.encryption.username" value="bob"/>
+ <entry key="ws-security.signature.properties"
value="alice.properties"/>
+ <entry key="ws-security.signature.username" value="alice"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedAttachmentsPort2"
createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="Alice"/>
+ <entry key="ws-security.callback-handler"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ <entry key="ws-security.encryption.properties"
value="bob.properties"/>
+ <entry key="ws-security.encryption.username" value="bob"/>
+ <entry key="ws-security.signature.properties"
value="alice.properties"/>
+ <entry key="ws-security.signature.username" value="alice"/>
+ </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-body-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:client>
+
</beans>
Added:
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-attachments-policy.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-attachments-policy.xml?rev=1542275&view=auto
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-attachments-policy.xml
(added)
+++
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-attachments-policy.xml
Fri Nov 15 14:37:43 2013
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<wsp:Policy
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://www.w3.org/ns/ws-policy" wsu:Id="RequiredPartsPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ <sp:RequireIssuerSerialReference/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:EncryptedParts
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Attachments />
+ </sp:EncryptedParts>
+ <sp:SignedParts
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ </sp:SignedParts>
+ <wsaws:UsingAddressing
xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
Modified:
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/server.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/server.xml?rev=1542275&r1=1542274&r2=1542275&view=diff
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/server.xml
(original)
+++
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/server.xml
Fri Nov 15 14:37:43 2013
@@ -240,4 +240,78 @@
</p:policies>
</jaxws:features>
</jaxws:endpoint>
+
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="SignedAttachments"
+
address="http://localhost:${testutil.ports.Server}/DoubleItSignedAttachments"
+ serviceName="s:DoubleItService"
endpointName="s:DoubleItSignedAttachmentsPort"
+ implementor="org.apache.cxf.systest.ws.parts.DoubleIt3Impl"
+ 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.*"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="SignedAttachments2"
+
address="http://localhost:${testutil.ports.Server}/DoubleItSignedAttachments2"
+ serviceName="s:DoubleItService"
endpointName="s:DoubleItSignedAttachmentsPort2"
+ implementor="org.apache.cxf.systest.ws.parts.DoubleIt3Impl"
+ 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.*"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="EncryptedAttachments"
+
address="http://localhost:${testutil.ports.Server}/DoubleItEncryptedAttachments"
+ serviceName="s:DoubleItService"
endpointName="s:DoubleItEncryptedAttachmentsPort"
+ implementor="org.apache.cxf.systest.ws.parts.DoubleIt3Impl"
+ 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.*"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="EncryptedAttachments2"
+
address="http://localhost:${testutil.ports.Server}/DoubleItEncryptedAttachments2"
+ serviceName="s:DoubleItService"
endpointName="s:DoubleItEncryptedAttachmentsPort2"
+ implementor="org.apache.cxf.systest.ws.parts.DoubleIt3Impl"
+ 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.*"/>
+ </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-attachments-policy.xml"/>
+ </p:policies>
+ </jaxws:features>
+ </jaxws:endpoint>
+
</beans>
Added:
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/signed-attachments-policy.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/signed-attachments-policy.xml?rev=1542275&view=auto
==============================================================================
---
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/signed-attachments-policy.xml
(added)
+++
cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/signed-attachments-policy.xml
Fri Nov 15 14:37:43 2013
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<wsp:Policy
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://www.w3.org/ns/ws-policy" wsu:Id="RequiredPartsPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ <sp:RequireIssuerSerialReference/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:SignedParts
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Attachments />
+ </sp:SignedParts>
+ <wsaws:UsingAddressing
xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>