Adding @Ignore'd testcase for signature validation issue
Conflicts:
systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server.xml
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e1cbf848
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e1cbf848
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e1cbf848
Branch: refs/heads/2.7.x-fixes
Commit: e1cbf84860c7eeb85cfe2b41eb603df53739ed43
Parents: 6c60728
Author: Colm O hEigeartaigh <[email protected]>
Authored: Fri May 2 16:12:17 2014 +0100
Committer: Daniel Kulp <[email protected]>
Committed: Fri May 2 14:47:36 2014 -0400
----------------------------------------------------------------------
.../ws/action/SignatureWhitespaceTest.java | 116 ++++++++++++
.../cxf/systest/ws/action/DoubleItAction.wsdl | 3 +
.../org/apache/cxf/systest/ws/action/client.xml | 141 +++++++++++++++
.../action/request-with-trailing-whitespace.xml | 10 ++
.../org/apache/cxf/systest/ws/action/server.xml | 179 +++++++++++++++++++
5 files changed, 449 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e1cbf848/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
----------------------------------------------------------------------
diff --git
a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
new file mode 100644
index 0000000..d95bbee
--- /dev/null
+++
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
@@ -0,0 +1,116 @@
+/**
+ * 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.action;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+
+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.junit.BeforeClass;
+
+/**
+ * A test for CXF-5679.
+ */
+public class SignatureWhitespaceTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = allocatePort(Server.class);
+
+ private static final String NAMESPACE =
"http://www.example.org/contract/DoubleIt";
+ private static final QName SERVICE_QNAME = new QName(NAMESPACE,
"DoubleItService");
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue(
+ "Server failed to launch",
+ // run the server in the same process
+ // set this to false to fork
+ launchServer(Server.class, true)
+ );
+ }
+
+ @org.junit.AfterClass
+ public static void cleanup() throws Exception {
+ SecurityTestUtil.cleanup();
+ stopAllServers();
+ }
+
+ @org.junit.Test
+ public void testNormalSignedSOAPBody() throws Exception {
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = SignatureWhitespaceTest.class.getResource("client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl =
SignatureWhitespaceTest.class.getResource("DoubleItAction.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItSignaturePort");
+ DoubleItPortType port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(port, PORT);
+
+ port.doubleIt(25);
+
+ ((java.io.Closeable)port).close();
+ bus.shutdown(true);
+ }
+
+ // TODO test not working
+ @org.junit.Test
+ @org.junit.Ignore
+ public void testTrailingWhitespaceInSOAPBody() throws Exception {
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = SignatureWhitespaceTest.class.getResource("client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl =
SignatureWhitespaceTest.class.getResource("DoubleItAction.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItSignaturePort");
+
+ Dispatch<StreamSource> dispatch =
+ service.createDispatch(portQName, StreamSource.class,
Service.Mode.MESSAGE);
+
+ // Creating a DOMSource Object for the request
+
+ URL requestFile =
+
SignatureWhitespaceTest.class.getResource("request-with-trailing-whitespace.xml");
+
+ StreamSource request = new StreamSource(new
File(requestFile.getPath()));
+
+ updateAddressPort(dispatch, PORT);
+
+ // Make a successful request
+ StreamSource response = dispatch.invoke(request);
+ assertNotNull(response);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/e1cbf848/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
----------------------------------------------------------------------
diff --git
a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
index ec1d3e9..121db30 100644
---
a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
+++
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
@@ -66,6 +66,9 @@
<wsdl:port name="DoubleItSamlTokenPort"
binding="tns:DoubleItNoSecurityBinding">
<soap:address location="http://localhost:9001/DoubleItSamlToken" />
</wsdl:port>
+ <wsdl:port name="DoubleItSignaturePort"
binding="tns:DoubleItNoSecurityBinding">
+ <soap:address location="http://localhost:9001/DoubleItSignature"/>
+ </wsdl:port>
</wsdl:service>
</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/e1cbf848/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
----------------------------------------------------------------------
diff --git
a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
new file mode 100644
index 0000000..0dca80c
--- /dev/null
+++
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
@@ -0,0 +1,141 @@
+<?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:http="http://cxf.apache.org/transports/http/configuration"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy"
xmlns:sec="http://cxf.apache.org/configuration/security" 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/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/configuration/security
http://cxf.apache.org/schemas/configuration/security.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
cy.xsd">
+ <cxf:bus>
+ <cxf:features>
+ <p:policies/>
+ <cxf:logging/>
+ </cxf:features>
+ </cxf:bus>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleIt3DESEncryptionPort"
createdFromAPI="true">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.action.SecretKeyPasswordCallback"/>
+ <entry key="encryptSymmetricEncryptionKey"
value="false"/>
+ <entry key="encryptionSymAlgorithm"
value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.action.SecretKeyPasswordCallback"/>
+ <entry key="isBSPCompliant" value="false"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItUsernameTokenPort"
createdFromAPI="true">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ <entry key="user" value="Alice"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedPasswordPort"
createdFromAPI="true">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ <entry key="encryptionPropFile"
value="bob-enc.properties"/>
+ <entry key="encryptionUser" value="bob"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ <entry key="decryptionPropFile"
value="alice-enc.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItSignedTimestampPort"
createdFromAPI="true">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature Timestamp"/>
+ <entry key="signatureUser" value="alice"/>
+ <entry key="signaturePropFile"
value="alice.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{}{http://schemas.xmlsoap.org/soap/envelope/}Body;"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureVerificationPropFile"
value="alice.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:client>
+ <jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItSignaturePort"
createdFromAPI="true">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureUser" value="alice"/>
+ <entry key="signaturePropFile"
value="alice.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureVerificationPropFile"
value="alice.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:client>
+</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/e1cbf848/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-trailing-whitespace.xml
----------------------------------------------------------------------
diff --git
a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-trailing-whitespace.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-trailing-whitespace.xml
new file mode 100644
index 0000000..5369fb3
--- /dev/null
+++
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-trailing-whitespace.xml
@@ -0,0 +1,10 @@
+<soapenv:Envelope xmlns:doub="http://www.example.org/schema/DoubleIt"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:BinarySecurityToken
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
wsu:Id="X509-9E450DB8066C2DC474139904277046747">MIIENzCCAhUwggF+oAMCAQICBElUYAAwDQYJKoZIhvcNAQEFBQAwMzETMBEGA1UEChMKYXBhY2hlLm9yZzEMMAoGA1UECxMDZW5nMQ4wDAYDVQQDEwVjeGZjYTAeFw03MDAxMDEwMDAwMDBaFw0zODAxMTkwMzE0MDdaMDMxEzARBgNVBAoTCmFwYWNoZS5vcmcxDDAKBgNVBAsTA2VuZzEOMAwGA1UEAxMFY3hmY2EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOGBi9p1BUVpWm17gmjZTo6QkrpeiVZklOwUsVhZtnTpBlUiIqOghi/ZZXDww0iA8Y8aIaV8vL850D+kXr9muYQ78ii6fBTfKuuLQ+blHqWYamFjFJedYCqbgvg5OTpvcJKQRQWSNsjGUtSuQ3SaBPK9ch/EpDX1JWl8dTseHLhZAgMBAAGjNjA0MCEGA1UdEgQaMBiCFk5PVF9GT1Jf
UFJPRFVDVElPTl9VU0UwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQALwODmMIEEwUztngEOEHZoxRag4TQ+Mmz/39lLNVSWlC6Lf3hmPLSJ2rAQCIahs1WTpyBbc+iPyphwYfZkO1zKtpDcuq/aVnLzcJLrT29jl24aFzNWyusSbi9Z3jLj3N1iVHKLknT8uui0U2JsCvGzkeEH3gwReoD1+ENeWrohRzCCAhowggGDoAMCAQICBElUYAEwDQYJKoZIhvcNAQEFBQAwMzETMBEGA1UEChMKYXBhY2hlLm9yZzEMMAoGA1UECxMDZW5nMQ4wDAYDVQQDEwVjeGZjYTAeFw03MDAxMDEwMDAwMDBaFw0zODAxMTkwMzE0MDdaMDMxEzARBgNVBAoTCmFwYWNoZS5vcmcxDDAKBgNVBAsTA2VuZzEOMAwGA1UEAxMFYWxpY2UwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL7u+O/1UoUPOX9egxknOCMYfT1aRoLshKqwrCvKvVxzmF/Zff4OcBAumXEdhcHzbKGh3CjT43ebEk81bQVpkI3wRHyKsE0e77ooTscjU8BM1cCCc76O6fP2mMZPlXQbUMauFMHiHH/4hZFGzNXGdaIl0UM3IkQYvgtQUAkBNKs7AgMBAAGjOzA5MCEGA1UdEgQaMBiCFk5PVF9GT1JfUFJPRFVDVElPTl9VU0UwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAIS8JJvvKbCreIJ24pBs1dE4KUlhnFsVigYvs/LSNp+oRQOb9Y1Rx2uBvYd7NJ8UNk3sM3kf5O4JoFdrCOPNzYK2B5k5iymgwVs2tqQLmbg4UB/BgBISWpBbSgT/vhAvazTaWZ6qh8cd6m9rVtuakbQcw5ivdtYIPTzKJjHO7qkU</wsse:BinarySecurityToken><ds:Signat
ure Id="SIG-9E450DB8066C2DC474139904277047151"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces
PrefixList="doub soapenv"
xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference
URI="#id-9E450DB8066C2DC474139904277046950"><ds:Transforms><ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces
PrefixList="doub"
xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>NjwLBwsqvjfogp5SpOQLf1O/8PE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>AzpBOq3B+60uGO2FI8Rjej5c1uZm3S+R5ZBYl7BAFam/lU+Lsk7a7vSZyAZJwHrTt16floie3t21
+Bv2rdFumRFDDUDYrJ5niEpUqx6w24jt9ZfaY6akhfxAsoWX8CEO7AtD5D6qgpVxaVKneNRYG72rY
+GoaDyT54NMaFvTape5s=</ds:SignatureValue><ds:KeyInfo
Id="KI-9E450DB8066C2DC474139904277046748"><wsse:SecurityTokenReference
wsse11:TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
wsu:Id="STR-9E450DB8066C2DC474139904277046749"
xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference
URI="#X509-9E450DB8066C2DC474139904277046747"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"/></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soapenv:Header>
+ <soapenv:Body wsu:Id="id-9E450DB8066C2DC474139904277046950"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <doub:DoubleIt>
+ <numberToDouble>25</numberToDouble>
+ </doub:DoubleIt>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/e1cbf848/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server.xml
----------------------------------------------------------------------
diff --git
a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server.xml
new file mode 100644
index 0000000..71fac62
--- /dev/null
+++
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server.xml
@@ -0,0 +1,179 @@
+<?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:util="http://www.springframework.org/schema/util"
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://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.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/s
chemas/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 ">
+ <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ <cxf:bus>
+ <cxf:features>
+ <p:policies/>
+ <cxf:logging/>
+ </cxf:features>
+ </cxf:bus>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="TripleDESEncryption"
address="http://localhost:${testutil.ports.Server}/DoubleIt3DESEncryption"
serviceName="s:DoubleItService" endpointName="s:DoubleIt3DESEncryptionPort"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.action.SecretKeyPasswordCallback"/>
+ <entry key="encryptSymmetricEncryptionKey"
value="false"/>
+ <entry key="encryptionSymAlgorithm"
value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.action.SecretKeyPasswordCallback"/>
+ <entry key="isBSPCompliant" value="false"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="UsernameToken"
address="http://localhost:${testutil.ports.Server}/DoubleItUsernameToken"
serviceName="s:DoubleItService" endpointName="s:DoubleItUsernameTokenPort"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="UsernameToken2"
address="http://localhost:${testutil.ports.Server}/DoubleItUsernameToken2"
serviceName="s:DoubleItService" endpointName="s:DoubleItUsernameTokenPort2"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="EncryptedPassword"
address="http://localhost:${testutil.ports.Server}/DoubleItEncryptedPassword"
serviceName="s:DoubleItService" endpointName="s:DoubleItEncryptedPasswordPort"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ <entry key="encryptionPropFile"
value="alice-enc.properties"/>
+ <entry key="encryptionUser" value="alice"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Encrypt"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ <entry key="decryptionPropFile"
value="bob-enc.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="SignedTimestamp"
address="http://localhost:${testutil.ports.Server}/DoubleItSignedTimestamp"
serviceName="s:DoubleItService" endpointName="s:DoubleItSignedTimestampPort"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureUser" value="bob"/>
+ <entry key="signaturePropFile" value="bob.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature Timestamp"/>
+ <entry key="signatureVerificationPropFile"
value="bob.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="Signature"
address="http://localhost:${testutil.ports.Server}/DoubleItSignature"
serviceName="s:DoubleItService" endpointName="s:DoubleItSignaturePort"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureUser" value="bob"/>
+ <entry key="signaturePropFile" value="bob.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureVerificationPropFile"
value="bob.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+
+ <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"
id="Signature2"
address="http://localhost:${testutil.ports.Server}/DoubleItSignature2"
serviceName="s:DoubleItService" endpointName="s:DoubleItSignaturePort2"
implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
wsdlLocation="org/apache/cxf/systest/ws/action/DoubleItAction.wsdl">
+ <jaxws:outInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureUser" value="bob"/>
+ <entry key="signaturePropFile" value="bob.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="passwordCallbackClass"
value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:outInterceptors>
+ <jaxws:inInterceptors>
+ <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="Signature"/>
+ <entry key="signatureVerificationPropFile"
value="bob.properties"/>
+ </map>
+ </constructor-arg>
+ </bean>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+</beans>