Index: modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
===================================================================
--- modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml	(revision 11981)
+++ modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml	(working copy)
@@ -184,6 +184,23 @@
        </webinf>
     </war>
 
+    <!-- jaxws-samples-wsse-username-authorize -->
+    <war
+       warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username-authorize.war"
+       webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml">
+       <classes dir="${tests.output.dir}/test-classes">
+          <include name="org/jboss/test/ws/jaxws/samples/wsse/Service*.class"/>
+          <include name="org/jboss/test/ws/jaxws/samples/wsse/jaxws/*.class"/>
+          <include name="org/jboss/test/ws/jaxws/samples/wsse/SubjectCreatingInterceptor.class"/>
+          <include name="org/jboss/test/ws/jaxws/samples/wsse/AuthenticationManagerLoader.class"/>
+       </classes>
+       <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize/WEB-INF">
+          <include name="jboss-web.xml"/>
+          <include name="jbossws-cxf.xml"/>
+          <include name="wsdl/*"/>
+       </webinf>
+    </war>
+
     <!-- jaxws-samples-wssePolicy-sign -->
     <war
        warfile="${tests.output.dir}/test-libs/jaxws-samples-wssePolicy-sign.war"
Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/AuthenticationManagerLoader.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/AuthenticationManagerLoader.java	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/AuthenticationManagerLoader.java	(revision 0)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.security.AuthenticationManager;
+
+/**
+ * AuthenticationManager loader 
+ *
+ */
+public class AuthenticationManagerLoader 
+{
+  public AuthenticationManager getManager()
+  {
+    try
+    {
+      Context ctx = new InitialContext();
+      Object obj = ctx.lookup("java:/comp/env/security/securityMgr");
+      return (AuthenticationManager)obj;
+    }
+    catch (NamingException ne)
+    {
+        throw new SecurityException("Unable to lookup AuthenticationManager");
+    }
+  }
+} 
+ 

Property changes on: modules\testsuite\cxf-tests\src\test\java\org\jboss\test\ws\jaxws\samples\wsse\AuthenticationManagerLoader.java
___________________________________________________________________
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java	(revision 0)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMe {}

Property changes on: modules\testsuite\cxf-tests\src\test\java\org\jboss\test\ws\jaxws\samples\wsse\jaxws\GreetMe.java
___________________________________________________________________
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java	(revision 0)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMeResponse
+{
+
+    @XmlElement(name = "return", namespace = "")
+    private String _return;
+
+    public String getReturn()
+    {
+        return this._return;
+    }
+
+    public void setReturn(String _return)
+    {
+        this._return = _return;
+    }
+
+}

Property changes on: modules\testsuite\cxf-tests\src\test\java\org\jboss\test\ws\jaxws\samples\wsse\jaxws\GreetMeResponse.java
___________________________________________________________________
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java	(revision 11981)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java	(working copy)
@@ -32,4 +32,7 @@
 {
    @WebMethod
    String sayHello();
+
+   @WebMethod
+   String greetMe();
 }
Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java	(revision 11981)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java	(working copy)
@@ -37,4 +37,8 @@
    {
       return "Secure Hello World!";
    }
+   public String greetMe()
+   {
+      return "Greetings!";
+   }
 }
Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SubjectCreatingInterceptor.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SubjectCreatingInterceptor.java	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SubjectCreatingInterceptor.java	(revision 0)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Map;
+
+import java.security.Principal;
+import java.security.acl.Group;
+import javax.security.auth.Subject;
+
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.security.SimplePrincipal;
+import org.apache.cxf.ws.security.wss4j.AbstractUsernameTokenAuthenticatingInterceptor;
+
+import org.jboss.logging.Logger;
+
+import org.jboss.security.AuthenticationManager;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+
+
+/**
+ * Interceptor which authenticates a current principal and populates Subject 
+ *
+ */
+public class SubjectCreatingInterceptor extends AbstractUsernameTokenAuthenticatingInterceptor 
+{
+  private static final Logger log = Logger.getLogger(SubjectCreatingInterceptor.class);
+  private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
+ 
+  // private NonceStore nonceStore;
+  private SecurityAdaptorFactory secAdaptorFactory;
+
+  public SubjectCreatingInterceptor()
+  {
+    this(Collections.<String, Object>emptyMap());
+  }
+
+  public SubjectCreatingInterceptor(Map<String, Object> properties)
+  {
+    super(properties);
+    SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+    secAdaptorFactory = spiProvider.getSPI(SecurityAdaptorFactory.class); 
+  }
+
+  @Override
+  public Subject createSubject(String name, String password, boolean isDigest,
+                               String nonce, String created)
+  {
+    // Load AuthenticationManager
+    // TODO : use PicketBox API
+
+    AuthenticationManagerLoader aml = null;
+    try
+    {
+      aml = AuthenticationManagerLoader.class.newInstance();
+    }
+    catch (Exception ex)
+    {
+      String msg = "AuthenticationManager can nont be loaded";
+      log.error(msg);
+      throw new SecurityException(msg);      
+    }
+
+    AuthenticationManager am = aml.getManager();
+   
+    // verify timestamp and nonce if digest
+    if (isDigest)
+    {
+      verifyUsernameToken(nonce, created);
+      // CallbackHandler cb = new UsernameTokenCallbackHandler(nonce, created);
+      // CallbackHandlerPolicyContextHandler.setCaallbackHandler(cb); 
+    }
+
+    // authenticate and populate Subject
+
+    Principal principal = new SimplePrincipal(name);
+    Subject subject = new Subject();
+
+    boolean TRACE = log.isTraceEnabled();
+    if (TRACE)
+      log.trace("About to authenticate, using security domain '" + am.getSecurityDomain() + "'"); 
+  
+    if (am.isValid(principal, password, subject) == false)
+    {
+      String msg = "Authentication failed, principal=" + principal.getName();
+      log.error(msg);
+      throw new SecurityException(msg);      
+    }
+
+    // push subject on the thread local storage
+    SecurityAdaptor adaptor = secAdaptorFactory.newSecurityAdapter();
+    adaptor.setPrincipal(principal);
+    adaptor.setCredential(password);
+    adaptor.pushSubjectContext(subject, principal, password);
+
+    if (TRACE)
+      log.trace("Authenticated, principal=" + name);
+
+    return subject;  
+  }
+
+
+  private void verifyUsernameToken(String nonce, String created)
+  {
+    if (created != null)
+    {
+      Calendar cal = SimpleTypeBindings.unmarshalDateTime(created);
+      Calendar ref = Calendar.getInstance();
+      ref.add(Calendar.SECOND, -TIMESTAMP_FRESHNESS_THRESHOLD);
+      if (ref.after(cal))
+        throw new SecurityException("Request rejected since a stale timestamp has been provided: " + created);
+    }
+
+   // if (nonce != null)
+   // {
+   //   if (nonceStore.hasNonce(nonce))
+          throw new SecurityException("Request rejected since a message with the same nonce has been recently received; nonce = " + nonce);
+   // }
+  }
+}
+ 

Property changes on: modules\testsuite\cxf-tests\src\test\java\org\jboss\test\ws\jaxws\samples\wsse\SubjectCreatingInterceptor.java
___________________________________________________________________
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
===================================================================
--- modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java	(revision 0)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * WS-Security username authorization test case
+ *
+ */
+public final class UsernameAuthorizationTestCase extends JBossWSTest
+{
+   private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-username-authorize";
+   
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(UsernameAuthorizationTestCase.class,"jaxws-samples-wsse-username-authorize.war");
+   }
+
+   public void testAuthorized() throws Exception
+   {
+      QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+      URL wsdlURL = new URL(serviceURL + "?wsdl");
+      Service service = Service.create(wsdlURL, serviceName);
+      ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+      setupWsse(proxy, "kermit");
+      assertEquals("Secure Hello World!", proxy.sayHello());
+   }
+   
+   public void testUnauthorized() throws Exception
+   {
+      QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+      URL wsdlURL = new URL(serviceURL + "?wsdl");
+      Service service = Service.create(wsdlURL, serviceName);
+      ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+      setupWsse(proxy, "kermit");
+      try 
+      { 
+        proxy.greetMe();
+        fail("User kermit should not be authorized to invoke greetMe.");
+      }
+      catch (Exception ex)
+      {
+        assertEquals("Unauthorized", ex.getMessage());
+      } 
+   }
+    
+   private void setupWsse(ServiceIface proxy, String username)
+   {
+      Client client = ClientProxy.getClient(proxy);
+      Endpoint cxfEndpoint = client.getEndpoint();
+      
+      Map<String,Object> outProps = new HashMap<String,Object>();
+      outProps.put("action", "UsernameToken");
+      outProps.put("user", username);
+      outProps.put("passwordType", "PasswordText");
+      outProps.put("passwordCallbackClass", "org.jboss.test.ws.jaxws.samples.wsse.UsernamePasswordCallback");
+      WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); //request
+      cxfEndpoint.getOutInterceptors().add(wssOut);
+      cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+   }
+}

Property changes on: modules\testsuite\cxf-tests\src\test\java\org\jboss\test\ws\jaxws\samples\wsse\UsernameAuthorizationTestCase.java
___________________________________________________________________
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml
===================================================================
--- modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml	(revision 0)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+   <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>

Property changes on: modules\testsuite\cxf-tests\src\test\resources\jaxws\samples\wsse\username-authorize\WEB-INF\jboss-web.xml
___________________________________________________________________
Added: svn:mime-type
   + text/xml
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml
===================================================================
--- modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml	(revision 0)
@@ -0,0 +1,45 @@
+<beans
+  xmlns='http://www.springframework.org/schema/beans'
+  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+  xmlns:beans='http://www.springframework.org/schema/beans'
+  xmlns:jaxws='http://cxf.apache.org/jaxws'
+  xmlns:util='http://www.springframework.org/schema/util'
+  xsi:schemaLocation='http://cxf.apache.org/core
+    http://cxf.apache.org/schemas/core.xsd
+    http://www.springframework.org/schema/util
+    http://www.springframework.org/schema/util/spring-util-2.0.xsd
+    http://www.springframework.org/schema/beans
+    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+    http://cxf.apache.org/jaxws
+    http://cxf.apache.org/schemas/jaxws.xsd'>
+  
+  <bean id="SecurityContextIn" class="org.jboss.test.ws.jaxws.samples.wsse.SubjectCreatingInterceptor">
+    <constructor-arg>
+      <map>
+        <entry key="action" value="UsernameToken"/> 
+      </map>
+    </constructor-arg>
+  </bean>
+ 
+  <util:map id="methodPermissions">
+     <entry key="sayHello" value="friend"/> 
+     <entry key="greetMe" value="snoopies"/> 
+  </util:map>
+ 
+  <bean id="AuthorizeIn" class="org.apache.cxf.interceptor.security.SimpleAuthorizingInterceptor">
+   <property name="methodRolesMap" ref="methodPermissions"/> 
+  </bean>
+  
+  <jaxws:endpoint
+    id='ServiceImpl'
+    address='http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-authorize'
+    implementor='org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl'>
+    <jaxws:inInterceptors>
+        <ref bean="SecurityContextIn"/>
+        <ref bean="AuthorizeIn"/>
+        <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+    </jaxws:inInterceptors>
+  </jaxws:endpoint>
+  
+  
+</beans>

Property changes on: modules\testsuite\cxf-tests\src\test\resources\jaxws\samples\wsse\username-authorize\WEB-INF\jbossws-cxf.xml
___________________________________________________________________
Added: svn:mime-type
   + text/xml
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml
===================================================================
--- modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml	(revision 0)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+   version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+   <servlet>
+      <servlet-name>TestService</servlet-name>
+      <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl</servlet-class>
+   </servlet>
+   <servlet-mapping>
+      <servlet-name>TestService</servlet-name>
+      <url-pattern>/*</url-pattern>
+   </servlet-mapping>
+</web-app>

Property changes on: modules\testsuite\cxf-tests\src\test\resources\jaxws\samples\wsse\username-authorize\WEB-INF\web.xml
___________________________________________________________________
Added: svn:mime-type
   + text/xml
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl	(revision 0)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
+		xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		xmlns="http://schemas.xmlsoap.org/wsdl/">
+  <types>
+    <xsd:schema>
+      <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" schemaLocation="SecurityService_schema1.xsd"/>
+    </xsd:schema>
+  </types>
+  <message name="sayHello">
+    <part name="parameters" element="tns:sayHello"/>
+  </message>
+  <message name="sayHelloResponse">
+    <part name="parameters" element="tns:sayHelloResponse"/>
+  </message>
+  <message name="greetMe">
+    <part name="parameters" element="tns:greetMe"/>
+  </message>
+  <message name="greetMeResponse">
+    <part name="parameters" element="tns:greetMeResponse"/>
+  </message>
+   <portType name="ServiceIface">
+    <operation name="sayHello">
+      <input message="tns:sayHello"/>
+      <output message="tns:sayHelloResponse"/>
+    </operation>
+    <operation name="greetMe">
+      <input message="tns:greetMe"/>
+      <output message="tns:greetMeResponse"/>
+    </operation>
+ </portType>
+  <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <operation name="sayHello">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+    </operation>
+    <operation name="greetMe">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+    </operation>
+ </binding>
+  <service name="SecurityService">
+    <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+      <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-authorize"/>
+    </port>
+  </service>
+</definitions>

Property changes on: modules\testsuite\cxf-tests\src\test\resources\jaxws\samples\wsse\username-authorize\WEB-INF\wsdl\SecurityService.wsdl
___________________________________________________________________
Added: svn:mime-type
   + text/xml
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd	(revision 0)
+++ modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd	(revision 0)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <xs:element name="sayHello" type="tns:sayHello"/>
+
+  <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+  <xs:complexType name="sayHello">
+    <xs:sequence/>
+  </xs:complexType>
+
+  <xs:complexType name="sayHelloResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:element name="greetMe" type="tns:greetMe"/>
+
+  <xs:element name="greetMeResponse" type="tns:greetMeResponse"/>
+
+  <xs:complexType name="greetMe">
+    <xs:sequence/>
+  </xs:complexType>
+
+  <xs:complexType name="greetMeResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
+

Property changes on: modules\testsuite\cxf-tests\src\test\resources\jaxws\samples\wsse\username-authorize\WEB-INF\wsdl\SecurityService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
   + text/xml
Added: svn:keywords
   + Rev Date
Added: svn:eol-style
   + native

Index: pom.xml
===================================================================
--- pom.xml	(revision 11981)
+++ pom.xml	(working copy)
@@ -55,7 +55,7 @@
     <jbossws.jboss601.version>3.2.1.GA</jbossws.jboss601.version>
     -->
     <!-- END -->
-    <cxf.version>2.2.6</cxf.version>
+    <cxf.version>2.2.8-SNAPSHOT</cxf.version>
     <cxf.stax.version>1.0.1</cxf.stax.version>
     <cxf.asm.version>2.2.3</cxf.asm.version>
     <fastinfoset.api.version>1.2.7</fastinfoset.api.version>
