Author: coheigea Date: Fri May 25 18:40:14 2012 New Revision: 1342763 URL: http://svn.apache.org/viewvc?rev=1342763&view=rev Log: Merged revisions 1342756 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........ r1342756 | coheigea | 2012-05-25 19:25:57 +0100 (Fri, 25 May 2012) | 10 lines Merged revisions 1342711 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1342711 | coheigea | 2012-05-25 17:14:02 +0100 (Fri, 25 May 2012) | 2 lines Added some system tests to test signing and encrypting SOAP (1.1 + 1.2) faults ........ ........ Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImpl.java - copied, changed from r1342735, cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/Server.java - copied, changed from r1342735, cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/client.xml cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/server.xml Modified: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/DoubleItLogical.wsdl Modified: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java?rev=1342763&r1=1342762&r2=1342763&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java Fri May 25 18:40:14 2012 @@ -21,6 +21,7 @@ package org.apache.cxf.systest.ws.common import javax.jws.WebService; import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; import org.example.contract.doubleit.DoubleItPortType; @WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", @@ -29,7 +30,7 @@ import org.example.contract.doubleit.Dou @Features(features = "org.apache.cxf.feature.LoggingFeature") public class DoubleItImpl implements DoubleItPortType { - public int doubleIt(int numberToDouble) { + public int doubleIt(int numberToDouble) throws DoubleItFault { return numberToDouble * 2; } Modified: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java?rev=1342763&r1=1342762&r2=1342763&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java Fri May 25 18:40:14 2012 @@ -25,6 +25,7 @@ import javax.jws.WebService; import javax.xml.ws.WebServiceContext; import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; import org.example.contract.doubleit.DoubleItPortType; import org.junit.Assert; @@ -37,7 +38,7 @@ public class DoubleItPortTypeImpl implem @Resource WebServiceContext wsContext; - public int doubleIt(int numberToDouble) { + public int doubleIt(int numberToDouble) throws DoubleItFault { Principal pr = wsContext.getUserPrincipal(); Assert.assertNotNull("Principal must not be null", pr); Copied: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImpl.java (from r1342735, cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java) URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImpl.java?p2=cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImpl.java&p1=cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java&r1=1342735&r2=1342763&rev=1342763&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItPortTypeImpl.java (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImpl.java Fri May 25 18:40:14 2012 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.cxf.systest.ws.common; +package org.apache.cxf.systest.ws.fault; import java.security.Principal; @@ -25,8 +25,8 @@ import javax.jws.WebService; import javax.xml.ws.WebServiceContext; import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; import org.example.contract.doubleit.DoubleItPortType; -import org.junit.Assert; @WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", serviceName = "DoubleItService", @@ -37,13 +37,18 @@ public class DoubleItPortTypeImpl implem @Resource WebServiceContext wsContext; - public int doubleIt(int numberToDouble) { - Principal pr = wsContext.getUserPrincipal(); + public int doubleIt(int numberToDouble) throws DoubleItFault { - Assert.assertNotNull("Principal must not be null", pr); - Assert.assertNotNull("Principal.getName() must not return null", pr.getName()); + Principal pr = wsContext.getUserPrincipal(); + if ("alice".equals(pr.getName())) { + return numberToDouble * 2; + } - return numberToDouble * 2; + org.example.schema.doubleit.DoubleItFault internalFault = + new org.example.schema.doubleit.DoubleItFault(); + internalFault.setMajor((short)124); + internalFault.setMinor((short)1256); + throw new DoubleItFault("This is a fault", internalFault); } } Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java?rev=1342763&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java Fri May 25 18:40:14 2012 @@ -0,0 +1,130 @@ +/** + * 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.fault; + +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.BindingProvider; +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.systest.ws.fault.server.Server; +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; +import org.example.contract.doubleit.DoubleItPortType; +import org.junit.BeforeClass; + +/** + * A set of tests for (signing and encrypting) SOAP Faults. + */ +public class FaultTest extends AbstractBusClientServerTestBase { + 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 testSoap11() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = FaultTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItSoap11Port"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + // Make a successful invocation + ((BindingProvider)utPort).getRequestContext().put("ws-security.username", "alice"); + utPort.doubleIt(25); + + // Now make an invocation using another username + ((BindingProvider)utPort).getRequestContext().put("ws-security.username", "bob"); + ((BindingProvider)utPort).getRequestContext().put("ws-security.password", "password"); + try { + utPort.doubleIt(25); + fail("Expected failure on bob"); + } catch (Exception ex) { + assertTrue(ex.getMessage().contains("This is a fault")); + } + + bus.shutdown(true); + } + + @org.junit.Test + public void testSoap12() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = FaultTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItSoap12Port"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + // Make a successful invocation + ((BindingProvider)utPort).getRequestContext().put("ws-security.username", "alice"); + utPort.doubleIt(25); + + // Now make an invocation using another username + ((BindingProvider)utPort).getRequestContext().put("ws-security.username", "bob"); + ((BindingProvider)utPort).getRequestContext().put("ws-security.password", "password"); + try { + utPort.doubleIt(25); + fail("Expected failure on bob"); + } catch (Exception ex) { + assertTrue(ex.getMessage().contains("This is a fault")); + } + + bus.shutdown(true); + } + + +} Copied: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/Server.java (from r1342735, cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java) URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/Server.java?p2=cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/Server.java&p1=cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java&r1=1342735&r2=1342763&rev=1342763&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/DoubleItImpl.java (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/server/Server.java Fri May 25 18:40:14 2012 @@ -16,21 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.cxf.systest.ws.common; -import javax.jws.WebService; +package org.apache.cxf.systest.ws.fault.server; -import org.apache.cxf.feature.Features; -import org.example.contract.doubleit.DoubleItPortType; +import java.net.URL; -@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", - serviceName = "DoubleItService", - endpointInterface = "org.example.contract.doubleit.DoubleItPortType") -@Features(features = "org.apache.cxf.feature.LoggingFeature") -public class DoubleItImpl implements DoubleItPortType { - - public int doubleIt(int numberToDouble) { - return numberToDouble * 2; +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 Server extends AbstractBusTestServerBase { + + public Server() { + + } + + protected void run() { + URL busFile = Server.class.getResource("server.xml"); + Bus busLocal = new SpringBusFactory().createBus(busFile); + BusFactory.setDefaultBus(busLocal); + setBus(busLocal); + + try { + new Server(); + } catch (Exception e) { + e.printStackTrace(); + } } - } Modified: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/DoubleItLogical.wsdl URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/DoubleItLogical.wsdl?rev=1342763&r1=1342762&r2=1342763&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/DoubleItLogical.wsdl (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/DoubleItLogical.wsdl Fri May 25 18:40:14 2012 @@ -43,6 +43,14 @@ </xsd:complexType> </xsd:element> <xsd:element name="DoubleItHeader" type="xsd:int"/> + <xsd:element name="DoubleItFault"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="minor" type="xsd:short"/> + <xsd:element name="major" type="xsd:short"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="DoubleItRequest"> @@ -55,10 +63,14 @@ <wsdl:message name="DoubleItResponse"> <wsdl:part element="di:DoubleItResponse" name="parameters" /> </wsdl:message> + <wsdl:message name="DoubleItFault"> + <wsdl:part element="di:DoubleItFault" name="DoubleItFault" /> + </wsdl:message> <wsdl:portType name="DoubleItPortType"> <wsdl:operation name="DoubleIt"> <wsdl:input message="tns:DoubleItRequest" /> <wsdl:output message="tns:DoubleItResponse" /> + <wsdl:fault message="tns:DoubleItFault" name="DoubleItFault" /> </wsdl:operation> </wsdl:portType> <wsdl:portType name="DoubleItPortTypeHeader"> Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl?rev=1342763&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl Fri May 25 18:40:14 2012 @@ -0,0 +1,154 @@ +<?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. +--> +<wsdl:definitions name="DoubleIt" + 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" + targetNamespace="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:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > + + <wsdl:import location="src/test/resources/DoubleItLogical.wsdl" + namespace="http://www.example.org/contract/DoubleIt"/> + + <wsdl:binding name="DoubleItSoap11Binding" type="tns:DoubleItPortType"> + <wsp:PolicyReference URI="#DoubleItPlaintextPolicy" /> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="DoubleIt"> + <soap:operation soapAction="" /> + <wsdl:input> + <soap:body use="literal" /> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/> + </wsdl:output> + <wsdl:fault name="DoubleItFault"> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/> + <soap:fault use="literal" name="DoubleItFault" /> + </wsdl:fault> + </wsdl:operation> + </wsdl:binding> + + <wsdl:binding name="DoubleItSoap12Binding" type="tns:DoubleItPortType"> + <wsp:PolicyReference URI="#DoubleItPlaintextPolicy" /> + <soap12:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="DoubleIt"> + <soap12:operation soapAction="" style="document"/> + <wsdl:input> + <soap12:body use="literal" /> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy"/> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/> + </wsdl:output> + <wsdl:fault name="DoubleItFault"> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/> + <soap12:fault use="literal" name="DoubleItFault" /> + </wsdl:fault> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="DoubleItService"> + <wsdl:port name="DoubleItSoap11Port" binding="tns:DoubleItSoap11Binding"> + <soap:address location="http://localhost:9009/DoubleItSoap11" /> + </wsdl:port> + <wsdl:port name="DoubleItSoap12Port" binding="tns:DoubleItSoap12Binding"> + <soap12:address location="http://localhost:9009/DoubleItSoap12" /> + </wsdl:port> + </wsdl:service> + + <wsp:Policy wsu:Id="DoubleItPlaintextPolicy"> + <wsp:ExactlyOne> + <wsp:All> + <sp:SymmetricBinding> + <wsp:Policy> + <sp:ProtectionToken> + <wsp:Policy> + <sp:X509Token + sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never"> + <wsp:Policy> + <sp:WssX509V3Token10 /> + <sp:RequireKeyIdentifierReference /> + </wsp:Policy> + </sp:X509Token> + </wsp:Policy> + </sp:ProtectionToken> + <sp:Layout> + <wsp:Policy> + <sp:Lax/> + </wsp:Policy> + </sp:Layout> + <sp:IncludeTimestamp/> + <sp:OnlySignEntireHeadersAndBody/> + <sp:AlgorithmSuite> + <wsp:Policy> + <sp:Basic128/> + </wsp:Policy> + </sp:AlgorithmSuite> + </wsp:Policy> + </sp:SymmetricBinding> + <sp:SupportingTokens> + <wsp:Policy> + <sp:UsernameToken + sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"> + <wsp:Policy> + <sp:WssUsernameToken10/> + </wsp:Policy> + </sp:UsernameToken> + </wsp:Policy> + </sp:SupportingTokens> + </wsp:All> + </wsp:ExactlyOne> + </wsp:Policy> + + <wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Input_Policy"> + <wsp:ExactlyOne> + <wsp:All> + <sp:EncryptedParts> + <sp:Body/> + </sp:EncryptedParts> + <sp:SignedParts> + <sp:Body/> + </sp:SignedParts> + </wsp:All> + </wsp:ExactlyOne> + </wsp:Policy> + <wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Output_Policy"> + <wsp:ExactlyOne> + <wsp:All> + <sp:EncryptedParts> + <sp:Body/> + </sp:EncryptedParts> + <sp:SignedParts> + <sp:Body/> + </sp:SignedParts> + </wsp:All> + </wsp:ExactlyOne> + </wsp:Policy> + +</wsdl:definitions> Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/client.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/client.xml?rev=1342763&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/client.xml (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client/client.xml Fri May 25 18:40:14 2012 @@ -0,0 +1,65 @@ +<?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/policy.xsd" +> + <cxf:bus> + <cxf:features> + <p:policies/> + <cxf:logging/> + </cxf:features> + </cxf:bus> + + <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSoap11Port" + createdFromAPI="true"> + <jaxws:properties> + <entry key="ws-security.callback-handler" + value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/> + <entry key="ws-security.encryption.properties" + value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/> + <entry key="ws-security.encryption.username" value="bob"/> + </jaxws:properties> + </jaxws:client> + + <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSoap12Port" + createdFromAPI="true"> + <jaxws:properties> + <entry key="ws-security.callback-handler" + value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/> + <entry key="ws-security.encryption.properties" + value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/> + <entry key="ws-security.encryption.username" value="bob"/> + </jaxws:properties> + </jaxws:client> + + +</beans> Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/server.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/server.xml?rev=1342763&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/server.xml (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server/server.xml Fri May 25 18:40:14 2012 @@ -0,0 +1,82 @@ +<?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 + "> + <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> + + <cxf:bus> + <cxf:features> + <p:policies/> + <cxf:logging/> + </cxf:features> + </cxf:bus> + + <jaxws:endpoint + id="Soap11" + address="http://localhost:${testutil.ports.Server}/DoubleItSoap11" + serviceName="s:DoubleItService" + endpointName="s:DoubleItSoap11Port" + xmlns:s="http://www.example.org/contract/DoubleIt" + implementor="org.apache.cxf.systest.ws.fault.DoubleItPortTypeImpl" + wsdlLocation="org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl"> + + <jaxws:properties> + <entry key="ws-security.callback-handler" + value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/> + <entry key="ws-security.signature.properties" + value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/> + </jaxws:properties> + + </jaxws:endpoint> + + <jaxws:endpoint + id="Soap12" + address="http://localhost:${testutil.ports.Server}/DoubleItSoap12" + serviceName="s:DoubleItService" + endpointName="s:DoubleItSoap12Port" + xmlns:s="http://www.example.org/contract/DoubleIt" + implementor="org.apache.cxf.systest.ws.fault.DoubleItPortTypeImpl" + wsdlLocation="org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl"> + + <jaxws:properties> + <entry key="ws-security.callback-handler" + value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/> + <entry key="ws-security.signature.properties" + value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/> + </jaxws:properties> + + </jaxws:endpoint> + +</beans>
