cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jp...@apache.org
Subject svn commit: r1437926 - in /cxf/branches/2.7.x-fixes/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/policy/ resources/java_first_policies/ resources/org/apache/cxf/systest/ws/policy/client/ resources/org/apache/cxf/systest/ws/policy/server/
Date Thu, 24 Jan 2013 10:06:19 GMT
Author: jpell
Date: Thu Jan 24 10:06:18 2013
New Revision: 1437926

URL: http://svn.apache.org/viewvc?rev=1437926&view=rev
Log:
CXF-4776 some test cases for verifying missing password tag is not treated as error

Added:
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/UsernameTokenValidator.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordToken.xml
      - copied, changed from r1437320, cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/SslWithUsernamePasswordToken.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
Removed:
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/SslWithUsernamePasswordToken.xml
Modified:
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyService.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AttachmentPolicy.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyService.java?rev=1437926&r1=1437925&r2=1437926&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyService.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyService.java
Thu Jan 24 10:06:18 2013
@@ -36,7 +36,7 @@ public interface JavaFirstPolicyService 
     void doOperationOne();
 
     @Policies({
-        @Policy(uri = "classpath:/java_first_policies/SslWithUsernamePasswordToken.xml",

+        @Policy(uri = "classpath:/java_first_policies/UsernamePasswordToken.xml", 
             placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT)
     })
     @WebMethod(operationName = "doOperationTwo")
@@ -50,7 +50,7 @@ public interface JavaFirstPolicyService 
     void doOperationThree();
     
     @Policies({
-        @Policy(uri = "classpath:/java_first_policies/SslWithUsernamePasswordToken.xml",

+        @Policy(uri = "classpath:/java_first_policies/UsernamePasswordToken.xml", 
             placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT)
     })
     @WebMethod(operationName = "doOperationFour")

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1437926&r1=1437925&r2=1437926&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
Thu Jan 24 10:06:18 2013
@@ -22,22 +22,34 @@ package org.apache.cxf.systest.ws.policy
 import java.io.InputStream;
 import java.io.StringReader;
 import java.net.HttpURLConnection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.service.model.MessageInfo.Type;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.policy.server.JavaFirstPolicyServer;
+import org.apache.cxf.systest.ws.wssec11.client.UTPasswordCallback;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+
 import org.apache.neethi.Constants;
 
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.handler.WSHandlerConstants;
+
 import org.junit.BeforeClass;
 
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 public class JavaFirstPolicyServiceTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(JavaFirstPolicyServer.class);
     static final String PORT2 = allocatePort(JavaFirstPolicyServer.class, 2);
@@ -57,7 +69,66 @@ public class JavaFirstPolicyServiceTest 
         SecurityTestUtil.cleanup();
         stopAllServers();
     }
-
+    
+    @org.junit.Test
+    public void testExecuteJavaFirstWebService() {
+        ClassPathXmlApplicationContext ctx = 
+            new ClassPathXmlApplicationContext("org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
+        
+        JavaFirstAttachmentPolicyService svc = 
+            (JavaFirstAttachmentPolicyService) ctx.getBean("JavaFirstAttachmentPolicyServiceClient");
+        
+        Client client = ClientProxy.getClient(svc);
+        client.getEndpoint().getEndpointInfo().setAddress(
+                                "http://localhost:" + PORT2 + "/JavaFirstAttachmentPolicyService");
+        
+       
+        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
+        client.getEndpoint().getOutInterceptors().add(wssOut);
+        
+        // just some basic sanity tests first to make sure that auth is working where password
is provided.
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        svc.doInputMessagePolicy();
+        
+        wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
+        try {
+            svc.doInputMessagePolicy();
+            fail("Expected authentication failure");
+        } catch (Exception e) {
+            assertTrue(true);
+        }
+        
+        // this test only 'works' because I overrode the default UsernameTokenValidator
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        
+        try {
+            svc.doInputMessagePolicy();
+            fail("Expected authentication failure");
+        } catch (Exception e) {
+            assertTrue(true);
+        }
+    }
+    
+    private Map<String, Object> getPasswordProperties(String username, String password)
{
+        UTPasswordCallback callback = new UTPasswordCallback();
+        callback.setAliasPassword(username, password);
+        
+        Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, callback);
+        outProps.put(WSHandlerConstants.USER, username);
+        return outProps;
+    }
+    
+    private Map<String, Object> getNoPasswordProperties(String username) {
+        Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_NONE);
+        outProps.put(WSHandlerConstants.USER, username);
+        return outProps;
+    }
+    
     @org.junit.Test
     public void testJavaFirstAttachmentWsdl() throws Exception {
         Document doc = loadWsdl("JavaFirstAttachmentPolicyService");

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/UsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/UsernameTokenValidator.java?rev=1437926&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/UsernameTokenValidator.java
(added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/UsernameTokenValidator.java
Thu Jan 24 10:06:18 2013
@@ -0,0 +1,34 @@
+/**
+ * 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.policy;
+
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.handler.RequestData;
+import org.apache.ws.security.message.token.UsernameToken;
+
+/**
+ * This ensures that the missing password is caught
+ */
+public class UsernameTokenValidator extends org.apache.ws.security.validate.UsernameTokenValidator
{
+    protected void verifyUnknownPassword(UsernameToken usernameToken,
+                                         RequestData data) throws WSSecurityException {
+        verifyPlaintextPassword(usernameToken, data);
+    }
+}

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AttachmentPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AttachmentPolicy.xml?rev=1437926&r1=1437925&r2=1437926&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AttachmentPolicy.xml
(original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AttachmentPolicy.xml
Thu Jan 24 10:06:18 2013
@@ -2,22 +2,23 @@
 
 <wsp:PolicyAttachment xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
 	xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
-	
+
 	<wsp:AppliesTo>
 		<wsp:URI>myurl</wsp:URI>
 	</wsp:AppliesTo>
-	
-	<wsp:Policy wsu:Id="UsernameToken" 
-	    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+
+	<wsp:Policy wsu:Id="UsernameToken"
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
 		<wsp:ExactlyOne>
 			<wsp:All>
 				<sp:SupportingTokens>
 					<wsp:Policy>
-						<sp:UsernameToken>
-	                     <wsp:Policy>
-	                        <sp:WssUsernameToken10 />
-	                     </wsp:Policy>
-	                  </sp:UsernameToken>
+						<sp:UsernameToken
+							sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+							<wsp:Policy>
+								<sp:WssUsernameToken11 />
+							</wsp:Policy>
+						</sp:UsernameToken>
 					</wsp:Policy>
 				</sp:SupportingTokens>
 			</wsp:All>

Copied: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordToken.xml
(from r1437320, cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/SslWithUsernamePasswordToken.xml)
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordToken.xml?p2=cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordToken.xml&p1=cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/SslWithUsernamePasswordToken.xml&r1=1437320&r2=1437926&rev=1437926&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/SslWithUsernamePasswordToken.xml
(original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordToken.xml
Thu Jan 24 10:06:18 2013
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 
-<wsp:Policy wsu:Id="TransportAndUsernamePolicy"
-	xmlns:wsp="http://www.w3.org/ns/ws-policy"
+<wsp:Policy wsu:Id="TransportAndUsernamePolicy" 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:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
 	<wsp:ExactlyOne>
@@ -9,10 +8,10 @@
 			<sp:SupportingTokens>
 				<wsp:Policy>
 					<sp:UsernameToken>
-                     <wsp:Policy>
-                        <sp:WssUsernameToken10 />
-                     </wsp:Policy>
-                  </sp:UsernameToken>
+						<wsp:Policy>
+							<sp:WssUsernameToken10 />
+						</wsp:Policy>
+					</sp:UsernameToken>
 				</wsp:Policy>
 			</sp:SupportingTokens>
 		</wsp:All>

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml?rev=1437926&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
(added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
Thu Jan 24 10:06:18 2013
@@ -0,0 +1,60 @@
+<?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
+          http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd"
+>
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+	
+	<http:conduit name="https://localhost:.*">
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/security/Truststore.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>  
+    
+    <jaxws:client 
+		id="JavaFirstAttachmentPolicyServiceClient" serviceClass="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService">
+		<jaxws:properties>
+			<entry key="ws-security.username" value="jason" />
+		</jaxws:properties>
+		
+		
+	</jaxws:client>
+	
+</beans>

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml?rev=1437926&r1=1437925&r2=1437926&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml
(original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml
Thu Jan 24 10:06:18 2013
@@ -1,31 +1,21 @@
 <?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.
--->
+<!-- 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="
+	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
@@ -35,87 +25,92 @@
         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>
-    
-    <p:externalAttachment location="classpath:java_first_policies/AttachmentPolicy.xml"/>
-    
-    <!--  register a policy attachment appliesto checker! -->
-	<bean id="uridomainexpressionbuilder" 
-	    class="org.apache.cxf.systest.ws.policy.URIDomainExpressionBuilder" />
+	<bean
+		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+
+	<cxf:bus>
+		<cxf:features>
+			<p:policies />
+			<cxf:logging />
+		</cxf:features>
+	</cxf:bus>
+
+	<p:externalAttachment
+		location="classpath:java_first_policies/AttachmentPolicy.xml" />
+
+	<!-- register a policy attachment appliesto checker! -->
+	<bean id="uridomainexpressionbuilder"
+		class="org.apache.cxf.systest.ws.policy.URIDomainExpressionBuilder" />
+
+	<bean id="org.apache.cxf.systest.ws.policy.JavaFirstPolicyService"
+		class="org.apache.cxf.systest.ws.policy.JavaFirstPolicyServiceImpl" />
+
+	<bean
+		id="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService"
+		class="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyServiceImpl" />
+
+	<bean
+		id="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService2"
+		class="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyServiceImpl" />
+
+	<jaxws:endpoint id="JavaFirstPolicyService"
+		address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstPolicyService"
+		implementor="#org.apache.cxf.systest.ws.policy.JavaFirstPolicyService">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+		</jaxws:properties>
+	</jaxws:endpoint>
 	
-    <bean id="org.apache.cxf.systest.ws.policy.JavaFirstPolicyService"
-        class="org.apache.cxf.systest.ws.policy.JavaFirstPolicyServiceImpl" />
-    
-    <bean id="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService"
-        class="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyServiceImpl" />
-    
-    <bean id="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService2"
-        class="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyServiceImpl" />
-        
-    <jaxws:endpoint 
-       id="JavaFirstPolicyService"
-       address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstPolicyService"

-       implementor="#org.apache.cxf.systest.ws.policy.JavaFirstPolicyService">
-        
-       <jaxws:properties>
-          <entry key="ws-security.callback-handler"
-                value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
-       </jaxws:properties>
-    </jaxws:endpoint>
-    
-    <jaxws:endpoint 
-       id="JavaFirstAttachmentPolicyService"
-       address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstAttachmentPolicyService"

-       implementor="#org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService2">
-        
-       <jaxws:properties>
-          <entry key="ws-security.callback-handler"
-                value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
-       </jaxws:properties>
-       
-       <jaxws:features>
+	<jaxws:endpoint id="JavaFirstAttachmentPolicyService"
+		address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstAttachmentPolicyService"
+		implementor="#org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService2">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+				
+			<entry key="ws-security.ut.validator">
+				<bean class="org.apache.cxf.systest.ws.policy.UsernameTokenValidator" />
+			</entry>
+		</jaxws:properties>
+
+		<jaxws:features>
 			<p:policies />
-	   </jaxws:features>
-    </jaxws:endpoint> 
-    
-     <jaxws:endpoint 
-       id="JavaFirstAttachmentPolicyService2"
-       address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstAttachmentPolicyService2"

-       implementor="#org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService">
-        
-       <jaxws:properties>
-          <entry key="ws-security.callback-handler"
-                value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
-       </jaxws:properties>
-       
-       <jaxws:features>
+		</jaxws:features>
+	</jaxws:endpoint>
+
+	<jaxws:endpoint id="JavaFirstAttachmentPolicyService2"
+		address="http://localhost:${testutil.ports.JavaFirstPolicyServer.2}/JavaFirstAttachmentPolicyService2"
+		implementor="#org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+		</jaxws:properties>
+
+		<jaxws:features>
 			<p:policies />
-	   </jaxws:features>
-    </jaxws:endpoint> 
-    
-    <wsp:Policy wsu:Id="InternalTransportAndUsernamePolicy"
-	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
-	xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
-	xmlns:wsp="http://www.w3.org/ns/ws-policy">
-	<wsp:ExactlyOne>
-		<wsp:All>
-			<sp:SupportingTokens>
-				<wsp:Policy>
-					<sp:UsernameToken>
-                     <wsp:Policy>
-                        <sp:WssUsernameToken10 />
-                     </wsp:Policy>
-                  </sp:UsernameToken>
-				</wsp:Policy>
-			</sp:SupportingTokens>
-		</wsp:All>
-	</wsp:ExactlyOne>
-</wsp:Policy>
+		</jaxws:features>
+	</jaxws:endpoint>
+
+	<wsp:Policy wsu:Id="InternalTransportAndUsernamePolicy"
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+		xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+		xmlns:wsp="http://www.w3.org/ns/ws-policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:SupportingTokens>
+					<wsp:Policy>
+						<sp:UsernameToken>
+							<wsp:Policy>
+								<sp:WssUsernameToken10 />
+							</wsp:Policy>
+						</sp:UsernameToken>
+					</wsp:Policy>
+				</sp:SupportingTokens>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
 </beans>



Mime
View raw message