cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r979862 [8/19] - in /cxf/sandbox/oauth_1.0a: ./ api/ api/src/main/java/org/apache/cxf/ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/ws/addressing/ api/src/main/java/org/...
Date Tue, 27 Jul 2010 20:47:12 GMT
Modified: cxf/sandbox/oauth_1.0a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml Tue Jul 27 20:46:55 2010
@@ -68,12 +68,12 @@
 	   <hj:engine port="9001">
 	       <hj:threadingParameters minThreads="99" maxThreads="777"/>	      
 	     <hj:connector>
-           <beans:bean class="org.mortbay.jetty.bio.SocketConnector">
+           <beans:bean class="org.eclipse.jetty.server.bio.SocketConnector">
               <beans:property name = "port" value="9001" />
            </beans:bean>
          </hj:connector>
          <hj:handlers>
-           <beans:bean class="org.mortbay.jetty.handler.DefaultHandler"/>         
+           <beans:bean class="org.eclipse.jetty.server.handler.DefaultHandler"/>         
          </hj:handlers>
          <hj:sessionSupport>true</hj:sessionSupport>
 	  </hj:engine> 

Modified: cxf/sandbox/oauth_1.0a/rt/transports/http-osgi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/http-osgi/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/http-osgi/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/http-osgi/pom.xml Tue Jul 27 20:46:55 2010
@@ -56,8 +56,8 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <groupId>${servlet-api.group}</groupId>
+            <artifactId>${servlet-api.artifact}</artifactId>
             <scope>provided</scope>
         </dependency>
 

Modified: cxf/sandbox/oauth_1.0a/rt/transports/http/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/http/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/http/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/http/pom.xml Tue Jul 27 20:46:55 2010
@@ -64,8 +64,8 @@
             <scope>test</scope>
         </dependency>        
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <groupId>${servlet-api.group}</groupId>
+            <artifactId>${servlet-api.artifact}</artifactId>
             <scope>provided</scope>
         </dependency>
     </dependencies>

Modified: cxf/sandbox/oauth_1.0a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Tue Jul 27 20:46:55 2010
@@ -40,6 +40,7 @@ import java.util.logging.Logger;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.xml.namespace.QName;
@@ -52,6 +53,7 @@ import org.apache.cxf.common.util.Base64
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
+import org.apache.cxf.continuations.ContinuationProvider;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.HttpHeaderHelper;
 import org.apache.cxf.interceptor.Fault;
@@ -80,8 +82,9 @@ import org.apache.cxf.wsdl.EndpointRefer
 /**
  * Common base for HTTP Destination implementations.
  */
-public abstract class AbstractHTTPDestination extends AbstractMultiplexDestination implements Configurable,
-    Assertor {
+public abstract class AbstractHTTPDestination 
+    extends AbstractMultiplexDestination 
+    implements Configurable, Assertor {
     
     public static final String HTTP_REQUEST = "HTTP.REQUEST";
     public static final String HTTP_RESPONSE = "HTTP.RESPONSE";
@@ -91,7 +94,7 @@ public abstract class AbstractHTTPDestin
         
     public static final String RESPONSE_COMMITED = "http.response.done";
     public static final String REQUEST_REDIRECTED = "http.request.redirected";
-    
+    public static final String CXF_CONTINUATION_MESSAGE = "cxf.continuation.message";
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractHTTPDestination.class);
     
     private static final long serialVersionUID = 1L;
@@ -104,6 +107,7 @@ public abstract class AbstractHTTPDestin
     protected boolean fixedParameterOrder;
     protected boolean multiplexWithAddress;
     protected CertConstraints certConstraints;
+    protected boolean isServlet3;
     
     /**
      * Constructor
@@ -121,6 +125,13 @@ public abstract class AbstractHTTPDestin
         super(b, getTargetReference(getAddressValue(ei, dp), b), ei);  
         bus = b;
         
+        try {
+            ServletRequest.class.getMethod("isAsyncSupported");
+            isServlet3 = true;
+        } catch (Throwable t) {
+            //servlet 2.5 or earlier, no async support
+        }
+        
         initConfig();
     }
     
@@ -271,7 +282,10 @@ public abstract class AbstractHTTPDestin
                                 final ServletContext context, 
                                 final HttpServletRequest req, 
                                 final HttpServletResponse resp) throws IOException {
-
+        setupContinuation(inMessage,
+                          req, 
+                          resp);
+        
         DelegatingInputStream in = new DelegatingInputStream(req.getInputStream());
         inMessage.setContent(DelegatingInputStream.class, in);
         inMessage.setContent(InputStream.class, in);
@@ -337,7 +351,26 @@ public abstract class AbstractHTTPDestin
                 Arrays.asList(new Interceptor[] {CertConstraintsInterceptor.INSTANCE}));
 
     }
-    
+    protected Message retrieveFromContinuation(HttpServletRequest req) {
+        if (!isServlet3) {
+            return null;
+        }
+        return retrieveFromServlet3Async(req);
+    }
+    protected Message retrieveFromServlet3Async(HttpServletRequest req) {
+        if (req.isAsyncStarted()) {
+            return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+        }
+        return null;
+    }
+    protected void setupContinuation(Message inMessage,
+                      final HttpServletRequest req, 
+                      final HttpServletResponse resp) {
+        if (isServlet3) {
+            inMessage.put(ContinuationProvider.class.getName(), 
+                          new Servlet3ContinuationProvider(req, resp, inMessage));
+        }
+    }
     protected String getBasePath(String contextPath) throws IOException {
         if (StringUtils.isEmpty(endpointInfo.getAddress())) {
             return "";
@@ -470,6 +503,9 @@ public abstract class AbstractHTTPDestin
     }
     
     protected OutputStream flushHeaders(Message outMessage) throws IOException {
+        return flushHeaders(outMessage, true);
+    }
+    protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException {
         if (isResponseRedirected(outMessage)) {
             return null;
         }
@@ -507,6 +543,8 @@ public abstract class AbstractHTTPDestin
                 response.setContentLength(0);
                 response.flushBuffer();
                 response.getOutputStream().close();
+            } else if (!getStream) {
+                response.getOutputStream().close();
             } else {
                 responseStream = response.getOutputStream();                
             }
@@ -614,7 +652,7 @@ public abstract class AbstractHTTPDestin
          */
         public void close() throws IOException {
             if (wrappedStream == null) {
-                OutputStream responseStream = flushHeaders(outMessage);
+                OutputStream responseStream = flushHeaders(outMessage, false);
                 if (null != responseStream) {
                     wrappedStream = responseStream;
                 }

Modified: cxf/sandbox/oauth_1.0a/rt/transports/jbi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/jbi/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/jbi/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/jbi/pom.xml Tue Jul 27 20:46:55 2010
@@ -121,6 +121,9 @@
                         <DynamicImport-Package>
                         </DynamicImport-Package>
                         <Import-Package>
+                            javax.activation;version="[0.0,2)",
+                            javax.annotation;version="[0.0,2)",
+                            javax.jws*;version="[0.0,3)",
                             *
                         </Import-Package>
                         <Export-Package>
@@ -128,6 +131,7 @@
                             META-INF.cxf.transport.jbi
                         </Export-Package>
                         <_failok>true</_failok>
+                        <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
                     </instructions>
                 </configuration>
             </plugin>

Modified: cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java Tue Jul 27 20:46:55 2010
@@ -32,8 +32,6 @@ import javax.jbi.messaging.ExchangeStatu
 import javax.jbi.messaging.Fault;
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.NormalizedMessage;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.dom.DOMSource;
 
 import org.w3c.dom.Document;
@@ -42,6 +40,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.staxutils.StaxUtils;
 
 public class JBIDestinationOutputStream extends CachedOutputStream {
 
@@ -85,11 +84,10 @@ public class JBIDestinationOutputStream 
                 InputStream bais = getInputStream();
                 LOG.finest(new org.apache.cxf.common.i18n.Message(
                     "BUILDING.DOCUMENT", LOG).toString());
-                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
-                docBuilderFactory.setNamespaceAware(true);
-                DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
-                Document doc = builder.parse(bais);
-            
+                Document doc = StaxUtils.read(bais);
+                bais.close();
+                
+                
                 MessageExchange xchng = inMessage.get(MessageExchange.class);
                 LOG.fine(new org.apache.cxf.common.i18n.Message(
                     "CREATE.NORMALIZED.MESSAGE", LOG).toString());

Modified: cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIMessageHelper.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIMessageHelper.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIMessageHelper.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIMessageHelper.java Tue Jul 27 20:46:55 2010
@@ -19,37 +19,37 @@
 
 package org.apache.cxf.transport.jbi;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
 
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.Source;
 
+import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.staxutils.StaxUtils;
 
 public final class JBIMessageHelper {
 
-
-    private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance();
-
     private JBIMessageHelper() {
         // complete
     }
 
-    public static InputStream convertMessageToInputStream(Source src) throws IOException,
-        TransformerConfigurationException, TransformerException {
-
-        final Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
+    public static InputStream convertMessageToInputStream(Source src) throws IOException {
 
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        StreamResult result = new StreamResult(baos);
-        transformer.transform(src, result);
-        
-        return new ByteArrayInputStream(baos.toByteArray());
+        CachedOutputStream cos = new CachedOutputStream();
+        try {
+            StaxUtils.copy(src, cos);
+            return cos.getInputStream();
+        } catch (XMLStreamException e) {
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);
+            throw ioe;
+        } finally {
+            try {
+                cos.close();
+            } catch (Exception ex) {
+                //ignore
+            }
+        }
     }
 }

Modified: cxf/sandbox/oauth_1.0a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java Tue Jul 27 20:46:55 2010
@@ -218,8 +218,10 @@ public class JMSDestination extends Abst
             // handle the incoming message
             incomingObserver.onMessage(inMessage);
             
-            inMessage = inMessage.getExchange().getInMessage();
-            
+            if (inMessage.getExchange() != null 
+                && inMessage.getExchange().getInMessage() != null) {
+                inMessage = inMessage.getExchange().getInMessage();
+            }
             //need to propagate any exceptions back to Spring container 
             //so transactions can occur
             if (inMessage.getContent(Exception.class) != null && session != null) {

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/pom.xml Tue Jul 27 20:46:55 2010
@@ -92,7 +92,7 @@
              <dependencies>
                  <dependency>
                       <groupId>org.apache.geronimo.specs</groupId>
-                      <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+                      <artifactId>geronimo-jaxws_2.2_spec</artifactId>
                   </dependency>
                   <dependency>
                       <groupId>org.apache.geronimo.specs</groupId>

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue Jul 27 20:46:55 2010
@@ -852,7 +852,7 @@ public final class ContextUtils {
         if (msgInfo != null
             && msgInfo.getExtensionAttributes() != null) {
             String attr = getAction(msgInfo);
-            if (attr != null) {
+            if (!StringUtils.isEmpty(attr)) {
                 action = attr;
                 msgInfo.setProperty(ACTION, action);
             }

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java Tue Jul 27 20:46:55 2010
@@ -28,7 +28,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -47,6 +46,7 @@ import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ClientLifeCycleListener;
 import org.apache.cxf.endpoint.ClientLifeCycleManager;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -109,11 +109,9 @@ public class MAPAggregator extends Abstr
     };
 
     /**
-     * REVISIT: map usage implies that the *same* interceptor instance 
-     * is used in all chains.
+     * The cache to use for enforcing uniqueness.  Defaults to {@link DefaultMessageIdCache}.
      */
-    protected final Map<String, String> messageIDs = 
-        new ConcurrentHashMap<String, String>();
+    private MessageIdCache messageIdCache = new DefaultMessageIdCache();
     
     private boolean usingAddressingAdvisory = true;
     private boolean addressingRequired;
@@ -184,7 +182,31 @@ public class MAPAggregator extends Abstr
         addressingRequired = required;
     }
     
-    
+    /**
+     * Returns the cache used to enforce duplicate message IDs when
+     * {@link #allowDuplicates()} returns {@code false}.
+     *
+     * @return the cache used to enforce duplicate message IDs
+     */
+    public MessageIdCache getMessageIdCache() {
+        return messageIdCache;
+    }
+
+    /**
+     * Sets the cache used to enforce duplicate message IDs when
+     * {@link #allowDuplicates()} returns {@code false}.
+     *
+     * @param messageIdCache the cache to use
+     *
+     * @throws NullPointerException if {@code messageIdCache} is {@code null}
+     */
+    public void setMessageIdCache(MessageIdCache messageIdCache) {
+        if (messageIdCache == null) {
+            throw new NullPointerException("messageIdCache cannot be null.");
+        }
+        this.messageIdCache = messageIdCache;
+    }
+
     /**
      * Invoked for normal processing of inbound and outbound messages.
      *
@@ -329,7 +351,49 @@ public class MAPAggregator extends Abstr
         } 
         return false;
     }
-    
+
+   
+    private WSAddressingFeature getWSAddressingFeature(Message message) {
+        if (message.getExchange() != null && message.getExchange().getEndpoint() != null) {
+            Endpoint endpoint = message.getExchange().getEndpoint();
+            if (endpoint.getActiveFeatures() != null) {
+                for (AbstractFeature feature : endpoint.getActiveFeatures()) {
+                    if (feature instanceof WSAddressingFeature) {
+                        return (WSAddressingFeature)feature;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+    /**
+     * If the isRequestor(message) == true and isAddressRequired() == false
+     * Assert all the wsa related assertion to true
+     * 
+     * @param message the current message
+     */
+    private void assertAddressing(Message message) {
+        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
+        if (null == aim) {
+            return;
+        }
+        QName[] types = new QName[] {
+            MetadataConstants.ADDRESSING_ASSERTION_QNAME, MetadataConstants.USING_ADDRESSING_2004_QNAME,
+            MetadataConstants.USING_ADDRESSING_2005_QNAME, MetadataConstants.USING_ADDRESSING_2006_QNAME
+        };
+
+        for (QName type : types) {
+            assertAssertion(aim, type);
+            if (type.equals(MetadataConstants.ADDRESSING_ASSERTION_QNAME)) {
+                assertAssertion(aim, MetadataConstants.ANON_RESPONSES_ASSERTION_QNAME);
+                assertAssertion(aim, MetadataConstants.NON_ANON_RESPONSES_ASSERTION_QNAME);
+            } else if (type.equals(MetadataConstants.ADDRESSING_ASSERTION_QNAME_0705)) {
+                assertAssertion(aim, MetadataConstants.ANON_RESPONSES_ASSERTION_QNAME_0705);
+                assertAssertion(aim, MetadataConstants.NON_ANON_RESPONSES_ASSERTION_QNAME_0705);
+            }
+        }
+    }
+
     /**
      * Asserts all Addressing assertions for the current message, regardless their nested 
      * Policies.
@@ -497,6 +561,13 @@ public class MAPAggregator extends Abstr
             if (null != theMaps) {            
                 assertAddressing(message, theMaps.getReplyTo(), theMaps.getFaultTo());
             }
+            // If the wsa policy is enabled , but the client sets the
+            // WSAddressingFeature.isAddressingRequired to false , we need to assert all WSA assertion to true
+            if (!ContextUtils.isOutbound(message) && ContextUtils.isRequestor(message)
+                && getWSAddressingFeature(message) != null
+                && !getWSAddressingFeature(message).isAddressingRequired()) {
+                assertAddressing(message);
+            }
         }
         return continueProcessing;
     }
@@ -553,7 +624,7 @@ public class MAPAggregator extends Abstr
 
         if (inputMessage.getExtensionAttributes() != null) {
             String inputAction = ContextUtils.getAction(inputMessage);
-            if (inputAction != null) {
+            if (!StringUtils.isEmpty(inputAction)) {
                 return inputAction;
             }
         }
@@ -564,7 +635,7 @@ public class MAPAggregator extends Abstr
         MessageInfo outputMessage = operation.getOutput();
         if (outputMessage != null && outputMessage.getExtensionAttributes() != null) {
             String outputAction = ContextUtils.getAction(outputMessage);
-            if (outputAction != null) {
+            if (!StringUtils.isEmpty(outputAction)) {
                 return outputAction;
             }
         }
@@ -591,7 +662,7 @@ public class MAPAggregator extends Abstr
                 if (isSameFault(faultInfo, faultName)) {
                     if (faultInfo.getExtensionAttributes() != null) {
                         String faultAction = ContextUtils.getAction(faultInfo);
-                        if (faultAction != null) {
+                        if (!StringUtils.isEmpty(faultAction)) {
                             return faultAction;
                         }
                     }
@@ -630,6 +701,23 @@ public class MAPAggregator extends Abstr
         if (op.isUnwrapped()) {
             op = ((UnwrappedOperationInfo)op).getWrappedOperation();
         }
+        //CXF-2836:To correct the wsa:action header value for dispatch client
+        if (bop.getProperty("dispatchToOperation") != null) {
+            //modifies the bop and bp to the value of dispatch client really invokes, 
+            //This helps corrct the wsa:action header value
+            QName opName = (QName)bop.getProperty("dispatchToOperation");
+            OperationInfo dispatchOP = bop.getBinding().getService().getInterface().getOperation(opName);
+            BindingOperationInfo dispachBop = null;
+            for (BindingOperationInfo binfo : bop.getBinding().getOperations()) {
+                if (binfo.getOperationInfo().getName().toString().equals(opName.toString())) {
+                    dispachBop = binfo;
+                }
+            }
+            if (dispachBop != null && dispatchOP != null) {
+                bop = dispachBop;
+                op = dispatchOP;
+            }
+        }
         
         String actionUri = null;
         if (checkMessage) {
@@ -668,7 +756,7 @@ public class MAPAggregator extends Abstr
             if (explicitAction != null) {
                 actionUri = explicitAction;
             } else if (null == op.getOutputName()) {
-                actionUri = addPath(opNamespace, op.getOutput().getName().getLocalPart());
+                actionUri = addPath(opNamespace, op.getName().getLocalPart() + "Response");
             } else {
                 actionUri = addPath(opNamespace, op.getOutputName());
             }
@@ -721,9 +809,21 @@ public class MAPAggregator extends Abstr
                 if (isOutbound) {
                     conduit = ContextUtils.getConduit(conduit, message);
                 }
+                String s = (String)message.get(Message.ENDPOINT_ADDRESS);
                 EndpointReferenceType reference = conduit != null
                                                   ? conduit.getTarget()
                                                   : ContextUtils.getNoneEndpointReference();
+                if (conduit != null && !StringUtils.isEmpty(s) 
+                    && !reference.getAddress().getValue().equals(s)) {
+                    EndpointReferenceType ref = new EndpointReferenceType();
+                    AttributedURIType tp = new AttributedURIType();
+                    tp.setValue(s);
+                    ref.setAddress(tp);
+                    ref.setMetadata(reference.getMetadata());
+                    ref.setReferenceParameters(reference.getReferenceParameters());
+                    ref.getOtherAttributes().putAll(reference.getOtherAttributes());
+                    reference = ref;
+                }
                 maps.setTo(reference);
             }
 
@@ -1018,8 +1118,7 @@ public class MAPAggregator extends Abstr
             if (!allowDuplicates) {
                 AttributedURIType messageID = maps.getMessageID();
                 if (messageID != null
-                    && messageIDs.put(messageID.getValue(), 
-                                      messageID.getValue()) != null) {
+                    && !messageIdCache.checkUniquenessAndCacheId(messageID.getValue())) {
                     LOG.log(Level.WARNING,
                             "DUPLICATE_MESSAGE_ID_MSG",
                             messageID.getValue());

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java Tue Jul 27 20:46:55 2010
@@ -69,5 +69,25 @@ public class WSAddressingFeature extends
         mapAggregator.setAddressingRequired(required);
     }
     
-    
+    /**
+     * Returns the cache used to enforce duplicate message IDs when
+     * {@link #isAllowDuplicates()} returns {@code false}.
+     *
+     * @return the cache used to enforce duplicate message IDs
+     */
+    public MessageIdCache getMessageIdCache() {
+        return mapAggregator.getMessageIdCache();
+    }
+
+    /**
+     * Sets the cache used to enforce duplicate message IDs when
+     * {@link #isAllowDuplicates()} returns {@code false}.
+     *
+     * @param messageIdCache the cache to use
+     *
+     * @throws NullPointerException if {@code messageIdCache} is {@code null}
+     */
+    public void setMessageIdCache(MessageIdCache messageIdCache) {
+        mapAggregator.setMessageIdCache(messageIdCache);
+    }
 }

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java Tue Jul 27 20:46:55 2010
@@ -20,14 +20,13 @@ package org.apache.cxf.ws.addressing.spr
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
-import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
 
-public class AddressingBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
+public class AddressingBeanDefinitionParser extends AbstractBeanDefinitionParser {
 
     @Override
     protected Class getBeanClass(Element arg0) {
         return WSAddressingFeature.class;
     }
-
 }

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd Tue Jul 27 20:46:55 2010
@@ -30,6 +30,7 @@
            <xs:attribute name="allowDuplicates" type="xs:boolean"/>
            <xs:attribute name="usingAddressingAdvisory" type="xs:boolean"/>
            <xs:attribute name="addressingRequired" type="xs:boolean"/>
+           <xs:attribute name="messageIdCache" type="xs:string"/>
         </xs:complexType>
     </xs:element>
     

Modified: cxf/sandbox/oauth_1.0a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java Tue Jul 27 20:46:55 2010
@@ -253,7 +253,7 @@ public class MAPAggregatorTest extends A
 
     @Test(expected = SoapFault.class)
     public void testResponderInboundInvalidMAPs() throws Exception {
-        aggregator.messageIDs.put("urn:uuid:12345", "urn:uuid:12345");
+        aggregator.getMessageIdCache().checkUniquenessAndCacheId("urn:uuid:12345");
         Message message = setUpMessage(false, false, false, false, false, false, true);
         aggregator.setAllowDuplicates(false);
         aggregator.mediate(message, false);
@@ -263,7 +263,7 @@ public class MAPAggregatorTest extends A
 
     @Test(expected = SoapFault.class)
     public void testResponderInboundInvalidMAPsFault() throws Exception {
-        aggregator.messageIDs.put("urn:uuid:12345", "urn:uuid:12345");
+        aggregator.getMessageIdCache().checkUniquenessAndCacheId("urn:uuid:12345");
         Message message = setUpMessage(false, false, false, false, false, false, true);
         aggregator.setAllowDuplicates(false);
         aggregator.mediate(message, true);
@@ -574,7 +574,8 @@ public class MAPAggregatorTest extends A
                 setUpRebase(message, exchange);
             }
         }
-        if (outbound || aggregator.messageIDs.size() > 0) {
+        if (outbound || ((DefaultMessageIdCache) aggregator.getMessageIdCache())
+            .getMessageIdSet().size() > 0) {
             if (!zeroLengthAction) {
                 Method method = SEI.class.getMethod("op", new Class[0]);
                 setUpMethod(message, exchange, method);

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/pom.xml Tue Jul 27 20:46:55 2010
@@ -61,6 +61,11 @@
             <artifactId>cxf-rt-core</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-bindings-soap</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <!-- Test stuff -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -169,7 +174,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.geronimo.specs</groupId>
-                    <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+                    <artifactId>geronimo-jaxws_2.2_spec</artifactId>
                     <scope>test</scope>
                 </dependency>
                 <dependency>

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java Tue Jul 27 20:46:55 2010
@@ -88,8 +88,16 @@ public class EndpointPolicyImpl implemen
     
     public EndpointPolicy updatePolicy(Policy p) {
         EndpointPolicyImpl epi = createEndpointPolicy();
-        Policy np = (Policy)p.normalize(true);
-        epi.setPolicy(getPolicy().merge(np));
+        
+        if (!PolicyUtils.isEmptyPolicy(p)) {
+            Policy normalizedPolicy = (Policy)p.normalize(true);
+            epi.setPolicy(getPolicy().merge(normalizedPolicy));
+        } else {
+            Policy clonedPolicy = new Policy();
+            clonedPolicy.addPolicyComponents(getPolicy().getPolicyComponents());
+            epi.setPolicy(clonedPolicy);
+        }
+        
         epi.checkExactlyOnes();
         epi.finalizeConfig();
         return epi;

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java Tue Jul 27 20:46:55 2010
@@ -72,13 +72,17 @@ public class PolicyAnnotationListener im
         case ENDPOINT_SELECTED: {
             Class<?> cls = (Class<?>)args[2];
             Endpoint ep = (Endpoint)args[1];
-            addPolicies(factory, ep, cls);
+            if (ep.getEndpointInfo().getInterface() != null) {
+                addPolicies(factory, ep, cls);
+            }
             break;
         }
         case SERVER_CREATED: {
             Class<?> cls = (Class<?>)args[2];
             Server server = (Server)args[0];
-            addPolicies(factory, server, cls);
+            if (server.getEndpoint().getEndpointInfo().getInterface() != null) {
+                addPolicies(factory, server, cls);
+            }
             break;
         }
         case INTERFACE_OPERATION_BOUND: {

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java
            ('svn:mergeinfo' removed)

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java
            ('svn:mergeinfo' removed)

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java Tue Jul 27 20:46:55 2010
@@ -28,6 +28,7 @@ import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.builder.primitive.NestedPrimitiveAssertion;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
+import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
 import org.apache.neethi.PolicyOperator;
 
@@ -42,6 +43,45 @@ public final class PolicyUtils {
     }  
     
     /**
+     * Checks if a given policy contains no policy components 
+     * or if it has only empty ExactlyOne or All components 
+     * containing no assertions 
+     * 
+     * @param p the policy
+     * @return true if the policy is empty
+     */
+    public static boolean isEmptyPolicy(Policy p) {
+        
+        return isEmptyPolicyOperator(p);
+    }
+    
+    /**
+     * Checks if a given policy operator has no policy components 
+     * or if it has only empty ExactlyOne or All components 
+     * containing no assertions 
+     * 
+     * @param p the policy operator
+     * @return true if this policy operator is empty
+     */
+    public static boolean isEmptyPolicyOperator(PolicyOperator p) {
+        
+        if (p.isEmpty()) {
+            return true;
+        }
+        
+        List components = p.getPolicyComponents();
+        
+        for (Object component : components) {
+            if (!(component instanceof PolicyOperator)
+                || !isEmptyPolicyOperator((PolicyOperator)component)) {
+                return false;
+            }
+        }
+        
+        return true;
+    }
+    
+    /**
      * Determine if a collection of assertions contains a given assertion, using
      * the equal method from the Assertion interface.
      * 

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java Tue Jul 27 20:46:55 2010
@@ -21,7 +21,10 @@ package org.apache.cxf.ws.policy;
 
 import java.util.logging.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
@@ -92,8 +95,19 @@ public class PolicyVerificationInInterce
                 effectivePolicy = pe.getEffectiveServerRequestPolicy(ei, boi);
             }
         }
-                
-        aim.checkEffectivePolicy(effectivePolicy.getPolicy());
+        try {
+            aim.checkEffectivePolicy(effectivePolicy.getPolicy());
+        } catch (PolicyException ex) {
+            //To check if there is ws addressing policy violation and throw WSA specific 
+            //exception to pass jaxws2.2 tests
+            if (ex.getMessage().indexOf("Addressing") > -1) {
+                throw new SoapFault("A required header representing a Message Addressing Property " 
+                                    + "is not present",
+                                    new QName("http://www.w3.org/2005/08/addressing", 
+                                              "MessageAddressingHeaderRequired"));
+            }
+            throw ex;
+        }
         LOG.fine("Verified policies for inbound message.");
     }
 

Modified: cxf/sandbox/oauth_1.0a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java Tue Jul 27 20:46:55 2010
@@ -37,8 +37,10 @@ import org.apache.neethi.All;
 import org.apache.neethi.Constants;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyOperator;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -222,6 +224,61 @@ public class EndpointPolicyImplTest exte
         assertTrue("Policy was not merged",
                    n1.equals(aqn1) && n2.equals(aqn2) || n1.equals(aqn2) && n2.equals(aqn1));
     }
+
+    @Test
+    public void testUpdatePolicyWithEmptyPolicy() {
+        
+        doTestUpdateWithEmptyPolicy(new Policy());
+    }
+    
+    @Test
+    public void testUpdatePolicyWithEmptyAll() {
+        
+        Policy emptyPolicy = new Policy();
+        emptyPolicy.addPolicyComponent(new All());
+        emptyPolicy.addPolicyComponent(new All());
+        doTestUpdateWithEmptyPolicy(emptyPolicy);
+    }
+    
+    @Test
+    public void testUpdatePolicyWithEmptyExactlyOneAndAll() {
+        
+        Policy emptyPolicy = new Policy();
+        PolicyOperator exactlyOne = new ExactlyOne();
+        exactlyOne.addPolicyComponent(new All());
+        exactlyOne.addPolicyComponent(new All());
+        emptyPolicy.addPolicyComponent(exactlyOne);
+        emptyPolicy.addPolicyComponent(new All());
+        emptyPolicy.addPolicyComponent(new All());
+        doTestUpdateWithEmptyPolicy(emptyPolicy);
+    }    
+    
+    private void doTestUpdateWithEmptyPolicy(Policy emptyPolicy) {
+        Policy p1 = new Policy();
+        QName aqn1 = new QName("http://x.y.z", "a");
+        p1.addAssertion(mockAssertion(aqn1, 5, true));
+        
+        EndpointPolicyImpl epi = new TestEndpointPolicy();
+        control.replay();
+        
+        epi.setPolicy((Policy)p1.normalize(true));
+                
+        Policy ep = epi.updatePolicy(emptyPolicy).getPolicy();
+        
+        List<ExactlyOne> pops = 
+            CastUtils.cast(ep.getPolicyComponents(), ExactlyOne.class);
+        assertEquals("New policy must have 1 top level policy operator", 1, pops.size());
+        List<All> alts = 
+            CastUtils.cast(pops.get(0).getPolicyComponents(), All.class);
+        assertEquals("1 alternatives should be available", 1, alts.size());
+        
+        List<PolicyAssertion> assertions1 = 
+            CastUtils.cast(alts.get(0).getAssertions(), PolicyAssertion.class);
+        assertEquals("1 assertion should be available", 1, assertions1.size());
+        
+        QName n1 = assertions1.get(0).getName();
+        assertTrue("Policy was not merged", n1.equals(aqn1));
+    }
     
     private PolicyAssertion mockAssertion(QName name, int howMany, boolean normalize) {
         PolicyAssertion a = control.createMock(PolicyAssertion.class);        

Modified: cxf/sandbox/oauth_1.0a/rt/ws/rm/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/rm/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/rm/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/rm/pom.xml Tue Jul 27 20:46:55 2010
@@ -153,7 +153,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.geronimo.specs</groupId>
-                    <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+                    <artifactId>geronimo-jaxws_2.2_spec</artifactId>
                 </dependency>
             </dependencies>
         </profile>

Modified: cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionInterceptor.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionInterceptor.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionInterceptor.java Tue Jul 27 20:46:55 2010
@@ -68,9 +68,15 @@ public class RetransmissionInterceptor e
         if (null == os) {
             return;
         }
-        
-        WriteOnCloseOutputStream stream = RMUtils.createCachedStream(message, os);
-        stream.registerCallback(new RetransmissionCallback(message, getManager()));
+        if (isFault) { 
+            // remove the exception set by the PhaseInterceptorChain so that the 
+            // error does not reach the client when retransmission is scheduled 
+            message.setContent(Exception.class, null);
+            message.getExchange().put(Exception.class, null); 
+        } else { 
+            WriteOnCloseOutputStream stream = RMUtils.createCachedStream(message, os);
+            stream.registerCallback(new RetransmissionCallback(message, getManager()));
+        }
     }
 }
     

Modified: cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java Tue Jul 27 20:46:55 2010
@@ -263,14 +263,14 @@ public class RetransmissionQueueImpl imp
         if (null != maps) {
             to = maps.getTo();
         }
-        if (RMUtils.getAddressingConstants().getAnonymousURI().equals(to.getValue())) {
-            LOG.log(Level.FINE, "Cannot resend to anonymous target");
-            return;
-        }
         if (null == to) {
             LOG.log(Level.SEVERE, "NO_ADDRESS_FOR_RESEND_MSG");
             return;
         }
+        if (RMUtils.getAddressingConstants().getAnonymousURI().equals(to.getValue())) {
+            LOG.log(Level.FINE, "Cannot resend to anonymous target");
+            return;
+        }
         
         final String address = to.getValue();
         LOG.fine("Resending to address: " + address);

Modified: cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java Tue Jul 27 20:46:55 2010
@@ -24,7 +24,6 @@ import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Marshaller;
-import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -37,6 +36,7 @@ import org.apache.cxf.binding.soap.SoapV
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.ws.rm.BindingFaultFactory;
 import org.apache.cxf.ws.rm.Identifier;
@@ -98,9 +98,7 @@ public class SoapFaultFactory implements
     }
     
     void setDetail(SoapFault fault, Object detail) throws Exception {
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        factory.setNamespaceAware(true);
-        Document doc = factory.newDocumentBuilder().newDocument();
+        Document doc = DOMUtils.createDocument();
         Element elem = null;
         
         JAXBContext ctx = JAXBContext.newInstance(

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java Tue Jul 27 20:46:55 2010
@@ -70,6 +70,8 @@ public final class SecurityConstants {
     public static final String STS_TOKEN_USERNAME = "ws-security.sts.token.username";
     
     public static final String STS_TOKEN_DO_CANCEL = "ws-security.sts.token.do.cancel";
+    
+    public static final String STS_TOKEN_ACT_AS = "ws-security.sts.token.act-as";
 
     public static final Set<String> ALL_PROPERTIES;
     
@@ -79,7 +81,8 @@ public final class SecurityConstants {
             SIGNATURE_USERNAME, SIGNATURE_PROPERTIES, SIGNATURE_CRYPTO,
             ENCRYPT_USERNAME, ENCRYPT_PROPERTIES, ENCRYPT_CRYPTO,
             TOKEN, TOKEN_ID, STS_CLIENT, STS_TOKEN_PROPERTIES, STS_TOKEN_CRYPTO,
-            STS_TOKEN_DO_CANCEL, TIMESTAMP_TTL, ALWAYS_ENCRYPT_UT
+            STS_TOKEN_DO_CANCEL, TIMESTAMP_TTL, ALWAYS_ENCRYPT_UT,
+            STS_TOKEN_ACT_AS
         }));
         ALL_PROPERTIES = Collections.unmodifiableSet(s);
     }

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SP11Constants.java
            ('svn:mergeinfo' removed)

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SP12Constants.java
            ('svn:mergeinfo' removed)

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
            ('svn:mergeinfo' removed)

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/
            ('svn:mergeinfo' removed)

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
            ('svn:mergeinfo' removed)

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java Tue Jul 27 20:46:55 2010
@@ -24,8 +24,9 @@ import java.util.List;
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
@@ -60,23 +61,29 @@ public class UsernameTokenBuilder implem
 
         Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
-            Element child = DOMUtils.getFirstElement(polEl);
-            if (child != null) {
-                QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
-                if (SPConstants.USERNAME_TOKEN10.equals(qname.getLocalPart())) {
-                    usernameToken.setUseUTProfile10(true);
-                } else if (SPConstants.USERNAME_TOKEN11.equals(qname.getLocalPart())) {
-                    usernameToken.setUseUTProfile11(true);
-                } else if (SP12Constants.NO_PASSWORD.equals(qname)) {
-                    usernameToken.setNoPassword(true);
-                } else if (SP12Constants.HASH_PASSWORD.equals(qname)) {
-                    usernameToken.setHashPassword(true);
-                } else if (SP12Constants.REQUIRE_DERIVED_KEYS.equals(qname)) {
-                    usernameToken.setDerivedKeys(true);
-                } else if (SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS.equals(qname)) {
-                    usernameToken.setExplicitDerivedKeys(true);
-                } else if (SP12Constants.REQUIRE_IMPLIED_DERIVED_KEYS.equals(qname)) {
-                    usernameToken.setImpliedDerivedKeys(true);
+            NodeList children = polEl.getChildNodes();
+            if (children != null) {
+                for (int i = 0; i < children.getLength(); i++) {
+                    Node child = children.item(i);
+                    if (child instanceof Element) {
+                        child = (Element)child;
+                        QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
+                        if (SPConstants.USERNAME_TOKEN10.equals(qname.getLocalPart())) {
+                            usernameToken.setUseUTProfile10(true);
+                        } else if (SPConstants.USERNAME_TOKEN11.equals(qname.getLocalPart())) {
+                            usernameToken.setUseUTProfile11(true);
+                        } else if (SP12Constants.NO_PASSWORD.equals(qname)) {
+                            usernameToken.setNoPassword(true);
+                        } else if (SP12Constants.HASH_PASSWORD.equals(qname)) {
+                            usernameToken.setHashPassword(true);
+                        } else if (SP12Constants.REQUIRE_DERIVED_KEYS.equals(qname)) {
+                            usernameToken.setDerivedKeys(true);
+                        } else if (SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS.equals(qname)) {
+                            usernameToken.setExplicitDerivedKeys(true);
+                        } else if (SP12Constants.REQUIRE_IMPLIED_DERIVED_KEYS.equals(qname)) {
+                            usernameToken.setImpliedDerivedKeys(true);
+                        }
+                    }
                 }
             }
         }

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java Tue Jul 27 20:46:55 2010
@@ -80,6 +80,10 @@ public class IssuedTokenInterceptorProvi
             client.setEndpointName(ep.getEndpointInfo().getName().toString() + ".sts-client");
             client.setBeanName(ep.getEndpointInfo().getName().toString() + ".sts-client");
         }
+        
+        // Transpose ActAs info from original request to the STS client.
+        client.setActAs(message.getContextualProperty(SecurityConstants.STS_TOKEN_ACT_AS));
+        
         return client;
     }
     static class IssuedTokenOutInterceptor extends AbstractPhaseInterceptor<Message> {

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/
            ('svn:mergeinfo' removed)

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Tue Jul 27 20:46:55 2010
@@ -21,6 +21,7 @@ package org.apache.cxf.ws.security.trust
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.StringReader;
 import java.net.URL;
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
@@ -140,6 +141,8 @@ public class STSClient implements Config
 
     boolean isSecureConv;
     int ttl = 300;
+    
+    Object actAs;
 
     Map<String, Object> ctx = new HashMap<String, Object>();
     
@@ -273,6 +276,11 @@ public class STSClient implements Config
     public void setEndpointQName(QName qn) {
         endpointName = qn;
     }
+    
+    public void setActAs(Object actAs) {
+        this.actAs = actAs;
+    }
+    
     public void setKeySize(int i) {
         keySize = i;
     }
@@ -373,8 +381,14 @@ public class STSClient implements Config
         writer.writeStartElement("wst", "RequestSecurityToken", namespace);
         writer.writeNamespace("wst", namespace);
         boolean wroteKeySize = false;
+        
         String keyType = null;
+        
         if (template != null) {
+            if (this.useSecondaryParameters()) {
+                writer.writeStartElement("wst", "SecondaryParameters", namespace);
+            }
+            
             Element tl = DOMUtils.getFirstElement(template);
             while (tl != null) {
                 StaxUtils.copy(tl, writer);
@@ -386,11 +400,13 @@ public class STSClient implements Config
                 }
                 tl = DOMUtils.getNextElement(tl);
             }
+            
+            if (this.useSecondaryParameters()) {
+                writer.writeEndElement();
+            }
         }
 
-        writer.writeStartElement("wst", "RequestType", namespace);
-        writer.writeCharacters(namespace + requestType);
-        writer.writeEndElement();
+        addRequestType(requestType, writer);
         addAppliesTo(writer, appliesTo);
         keyType = writeKeyType(writer, keyType);
 
@@ -456,6 +472,9 @@ public class STSClient implements Config
             StaxUtils.copy(el, writer);
             writer.writeEndElement();
         }
+        
+        addActAs(writer);
+        
         writer.writeEndElement();
 
         Object obj[] = client.invoke(boi, new DOMSource(writer.getDocument().getDocumentElement()));
@@ -466,6 +485,12 @@ public class STSClient implements Config
         }
         return token;
     }
+
+    private void addRequestType(String requestType, W3CDOMStreamWriter writer) throws XMLStreamException {
+        writer.writeStartElement("wst", "RequestType", namespace);
+        writer.writeCharacters(namespace + requestType);
+        writer.writeEndElement();
+    }
     
     private Element getDocumentElement(DOMSource ds) {
         Node nd = ds.getNode();
@@ -636,6 +661,10 @@ public class STSClient implements Config
             LOG.log(Level.WARNING, "Problem cancelling token", ex);
         }
     }
+    
+    private boolean useSecondaryParameters() {
+        return !STSUtils.WST_NS_05_02.equals(namespace);
+    }
 
     private String writeKeyType(W3CDOMStreamWriter writer, String keyType) throws XMLStreamException {
         if (isSecureConv) {
@@ -703,6 +732,35 @@ public class STSClient implements Config
             writer.writeEndElement();
         }
     }
+    
+    private void addActAs(W3CDOMStreamWriter writer) throws Exception {
+        if (this.actAs != null) {
+            final boolean isString = this.actAs instanceof String;
+            final boolean isElement = this.actAs instanceof Element; 
+            if (isString || isElement) {
+                final Element actAsEl;
+                
+                if (isString) {
+                    final Document acAsDoc =
+                        DOMUtils.readXml(new StringReader((String) this.actAs));
+                    actAsEl = acAsDoc.getDocumentElement();
+                } else {
+                    actAsEl = (Element) this.actAs;
+                }
+                
+                writer.writeStartElement(STSUtils.WST_NS_08_02, "ActAs");
+                
+                // Unlikely to ever be otherwise, but still prudent to check.
+                if (actAsEl.getOwnerDocument() != writer.getDocument()) {
+                    writer.getDocument().adoptNode(actAsEl);
+                }
+                
+                writer.getCurrentNode().appendChild(actAsEl);
+                
+                writer.writeEndElement();
+            }
+        }
+    }
 
     private SecurityToken createSecurityToken(Element el, byte[] requestorEntropy)
         throws WSSecurityException {

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java Tue Jul 27 20:46:55 2010
@@ -48,9 +48,18 @@ import org.apache.neethi.Policy;
  * 
  */
 public final class STSUtils {
+    /**
+     * WS-T 1.0 Namespace.
+     */
     public static final String WST_NS_05_02 = "http://schemas.xmlsoap.org/ws/2005/02/trust";
+    /**
+     * WS-T 1.3 Namespace.
+     */
     public static final String WST_NS_05_12 = "http://docs.oasis-open.org/ws-sx/ws-trust/200512";
-
+    /**
+     * WS-T 1.4 Namespace.
+     */
+    public static final String WST_NS_08_02 = "http://docs.oasis-open.org/ws-sx/ws-trust/200802";
     public static final String SCT_NS_05_02 = "http://schemas.xmlsoap.org/ws/2005/02/sc";
     public static final String SCT_NS_05_12 
         = "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512";

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
            ('svn:mergeinfo' removed)

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractUsernameTokenAuthenticatingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractUsernameTokenAuthenticatingInterceptor.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractUsernameTokenAuthenticatingInterceptor.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractUsernameTokenAuthenticatingInterceptor.java Tue Jul 27 20:46:55 2010
@@ -89,7 +89,9 @@ public abstract class AbstractUsernameTo
         supportDigestPasswords = support;
     }
     
-    
+    public boolean getSupportDigestPasswords() {
+        return supportDigestPasswords;
+    }
     
     @Override
     protected SecurityContext createSecurityContext(final Principal p) {
@@ -165,7 +167,11 @@ public abstract class AbstractUsernameTo
     protected CallbackHandler getCallback(RequestData reqData, int doAction) 
         throws WSSecurityException {
         
-        if ((doAction & WSConstants.UT) != 0 && !supportDigestPasswords) {    
+        // Given that a custom UT processor is used for dealing with digests 
+        // no callback handler is required when the request UT contains a digest;
+        // however a custom callback may still be needed for decrypting the encrypted UT
+        
+        if ((doAction & WSConstants.UT) != 0) {
             CallbackHandler pwdCallback = null;
             try {
                 pwdCallback = super.getCallback(reqData, doAction);
@@ -184,7 +190,6 @@ public abstract class AbstractUsernameTo
             return super.getSecurityEngine();
         }
         Map<QName, Object> profiles = new HashMap<QName, Object>(3);
-        profiles.put(new QName(WSConstants.USERNAMETOKEN_NS, WSConstants.USERNAME_TOKEN_LN), this);
         profiles.put(new QName(WSConstants.WSSE_NS, WSConstants.USERNAME_TOKEN_LN), this);
         profiles.put(new QName(WSConstants.WSSE11_NS, WSConstants.USERNAME_TOKEN_LN), this);
         return createSecurityEngine(profiles);
@@ -202,7 +207,7 @@ public abstract class AbstractUsernameTo
     }
     
     
-    private class DelegatingCallbackHandler implements CallbackHandler {
+    protected class DelegatingCallbackHandler implements CallbackHandler {
 
         private CallbackHandler pwdHandler;
         

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java Tue Jul 27 20:46:55 2010
@@ -141,7 +141,6 @@ public class WSS4JOutInterceptor extends
             
             boolean doDebug = LOG.isLoggable(Level.FINE);
             boolean doTimeDebug = TIME_LOG.isLoggable(Level.FINE);
-            SoapVersion version = mc.getVersion();
     
             long t0 = 0;
             long t1 = 0;
@@ -154,7 +153,14 @@ public class WSS4JOutInterceptor extends
             if (doDebug) {
                 LOG.fine("WSS4JOutInterceptor: enter handleMessage()");
             }
-    
+            /**
+             * There is nothing to send...Usually happens when the provider
+             * needs to send a HTTP 202 message (with no content)
+             */
+            if (mc == null) {
+                return;
+            }
+            SoapVersion version = mc.getVersion();
             RequestData reqData = new RequestData();
     
             reqData.setMsgContext(mc);
@@ -232,7 +238,8 @@ public class WSS4JOutInterceptor extends
                  * over the wire. Therefore this must shall be the last (or only)
                  * handler in a chain. Now we can perform our security operations on
                  * this request.
-                 */
+                 */              
+    
                 SOAPMessage saaj = mc.getContent(SOAPMessage.class);
     
                 if (saaj == null) {
@@ -242,14 +249,7 @@ public class WSS4JOutInterceptor extends
                 }
     
                 Document doc = saaj.getSOAPPart();
-                /**
-                 * There is nothing to send...Usually happens when the provider
-                 * needs to send a HTTP 202 message (with no content)
-                 */
-                if (mc == null) {
-                    return;
-                }
-    
+
                 if (doTimeDebug) {
                     t1 = System.currentTimeMillis();
                 }

Propchange: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
            ('svn:mergeinfo' removed)

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java Tue Jul 27 20:46:55 2010
@@ -641,7 +641,7 @@ public class SymmetricBindingHandler ext
             } else {
                 sig.setCustomTokenValueType(WSConstants.WSS_SAML_NS
                                       + WSConstants.SAML_ASSERTION_ID);
-                sig.setKeyIdentifierType(type);
+                sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
             }
             
             String sigTokId;

Modified: cxf/sandbox/oauth_1.0a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java Tue Jul 27 20:46:55 2010
@@ -66,7 +66,7 @@ public class UserNameTokenAuthorizationT
         wsIn.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/insecurity.properties");
         wsIn.setProperty(WSHandlerConstants.DEC_PROP_FILE, "META-INF/cxf/insecurity.properties");
         wsIn.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
-
+        
         service.getInInterceptors().add(wsIn);
          
         SimpleAuthorizingInterceptor sai = new SimpleAuthorizingInterceptor();

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/pom.xml Tue Jul 27 20:46:55 2010
@@ -142,8 +142,8 @@
     </profiles>
     <dependencies>
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <groupId>${servlet-api.group}</groupId>
+            <artifactId>${servlet-api.artifact}</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -196,6 +196,14 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+       		<groupId>org.eclipse.jetty</groupId>
+       		<artifactId>jetty-server</artifactId>
+        </dependency>
+          <dependency>
+       		<groupId>org.eclipse.jetty</groupId>
+       		<artifactId>jetty-webapp</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>${project.version}</version>

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -43,6 +43,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class AegisClientServerTest extends AbstractBusClientServerTestBase {
+    static final String PORT = allocatePort(AegisServer.class);
     static final Logger LOG = LogUtils.getLogger(AegisClientServerTest.class);
     
     @BeforeClass
@@ -56,7 +57,7 @@ public class AegisClientServerTest exten
         ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
         proxyFactory.setDataBinding(aegisBinding);
         proxyFactory.setServiceClass(AuthService.class);
-        proxyFactory.setAddress("http://localhost:9002/service");
+        proxyFactory.setAddress("http://localhost:" + PORT + "/service");
         AuthService service = (AuthService) proxyFactory.create();
         assertTrue(service.authenticate("Joe", "Joe", "123"));
         assertFalse(service.authenticate("Joe1", "Joe", "fang"));      
@@ -86,7 +87,7 @@ public class AegisClientServerTest exten
         JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
         proxyFactory.setDataBinding(aegisBinding);
         proxyFactory.setServiceClass(AuthService.class);
-        proxyFactory.setAddress("http://localhost:9002/jaxwsAndAegis");
+        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegis");
         AuthService service = (AuthService) proxyFactory.create();
         assertTrue(service.authenticate("Joe", "Joe", "123"));
         assertFalse(service.authenticate("Joe1", "Joe", "fang"));      
@@ -118,7 +119,7 @@ public class AegisClientServerTest exten
     
     @Test
     public void testWSDL() throws Exception {
-        URL url = new URL("http://localhost:9002/jaxwsAndAegis?wsdl");
+        URL url = new URL("http://localhost:" + PORT + "/jaxwsAndAegis?wsdl");
         Document dom = XMLUtils.parse(url.openStream());
         TestUtilities util = new TestUtilities(this.getClass());
         util.addDefaultNamespaces();
@@ -131,7 +132,7 @@ public class AegisClientServerTest exten
                            + "xsd:sequence/xsd:element[@nillable='true']",
                            dom);
         
-        url = new URL("http://localhost:9002/serviceWithCustomNS?wsdl");
+        url = new URL("http://localhost:" + PORT + "/serviceWithCustomNS?wsdl");
         dom = XMLUtils.parse(url.openStream());
         util.assertValid("//wsdl:definitions[@targetNamespace='http://foo.bar.com']",
                          dom);
@@ -143,7 +144,7 @@ public class AegisClientServerTest exten
         JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
         proxyFactory.setDataBinding(aegisBinding);
         proxyFactory.setServiceClass(SportsService.class);
-        proxyFactory.setWsdlLocation("http://localhost:9002/jaxwsAndAegisSports?wsdl");
+        proxyFactory.setWsdlLocation("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
         SportsService service = (SportsService) proxyFactory.create();
 
         Collection<Team> teams = service.getTeams();
@@ -158,7 +159,7 @@ public class AegisClientServerTest exten
     @Test
     public void testDynamicClient() throws Exception {
         DynamicClientFactory dcf = DynamicClientFactory.newInstance();
-        Client client = dcf.createClient("http://localhost:9002/jaxwsAndAegisSports?wsdl");
+        Client client = dcf.createClient("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
 
         Object r = client.invoke("getAttributeBean")[0];
         Method getAddrPlainString = r.getClass().getMethod("getAttrPlainString");

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java Tue Jul 27 20:46:55 2010
@@ -31,6 +31,7 @@ import org.apache.cxf.aegis.databinding.
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.systest.aegis.bean.Item;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
 
 import org.junit.Assert;
@@ -44,7 +45,8 @@ import org.springframework.test.context.
  */
 @ContextConfiguration(locations = { "classpath:aegisJaxWsBeans.xml" })
 public class AegisJaxWsTest extends AbstractJUnit4SpringContextTests {
-    
+    static final String PORT = TestUtil.getPortNumber(AegisJaxWsTest.class);
+
     private AegisJaxWs client;
     
     public AegisJaxWsTest() {
@@ -55,7 +57,7 @@ public class AegisJaxWsTest extends Abst
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setServiceClass(AegisJaxWs.class);
         if (sec) {
-            factory.setAddress("http://localhost:9167/aegisJaxWsUN");
+            factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsUN");
             WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor();
             wss4jOut.setProperty("action", "UsernameToken");
             wss4jOut.setProperty("user", "alice");
@@ -65,7 +67,7 @@ public class AegisJaxWsTest extends Abst
             factory.getProperties().put("password", "pass");
             factory.getOutInterceptors().add(wss4jOut);
         } else {
-            factory.setAddress("http://localhost:9167/aegisJaxWs");            
+            factory.setAddress("http://localhost:" + PORT + "/aegisJaxWs");            
         }
         factory.getServiceFactory().setDataBinding(new AegisDatabinding());
 

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java Tue Jul 27 20:46:55 2010
@@ -22,25 +22,26 @@ package org.apache.cxf.systest.aegis;
 import java.net.URISyntaxException;
 
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.handler.DefaultHandler;
-import org.mortbay.jetty.handler.HandlerCollection;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.webapp.WebAppContext;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.handler.DefaultHandler;
+import org.eclipse.jetty.server.handler.HandlerCollection;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.webapp.WebAppContext;
 
 
 public class AegisServer extends AbstractBusTestServerBase {
+    static final String PORT = allocatePort(AegisServer.class);
 
-    private org.mortbay.jetty.Server server;
+    private org.eclipse.jetty.server.Server server;
     
     protected void run() {
         System.out.println("Starting Server");
 
-        server = new org.mortbay.jetty.Server();
+        server = new org.eclipse.jetty.server.Server();
 
         SelectChannelConnector connector = new SelectChannelConnector();
-        connector.setPort(9002);
+        connector.setPort(Integer.parseInt(PORT));
         server.setConnectors(new Connector[] {connector});
 
         WebAppContext webappcontext = new WebAppContext();

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java Tue Jul 27 20:46:55 2010
@@ -30,6 +30,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.aegis.type.basic.CharacterAsStringType;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -43,7 +44,8 @@ import org.springframework.test.context.
  */
 @ContextConfiguration(locations = { "classpath:aegisSportsServiceBeans.xml" })
 public class CharacterSchemaTest extends AbstractJUnit4SpringContextTests {
-    
+    static final String PORT = TestUtil.getPortNumber(CharacterSchemaTest.class);
+
     private TestUtilities testUtilities;
     
     public CharacterSchemaTest() {

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java Tue Jul 27 20:46:55 2010
@@ -39,6 +39,7 @@ import org.apache.cxf.frontend.ClientPro
 import org.apache.cxf.systest.aegis.mtom.fortest.DataHandlerBean;
 import org.apache.cxf.systest.aegis.mtom.fortest.MtomTestImpl;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -51,7 +52,8 @@ import org.springframework.test.context.
  */
 @ContextConfiguration(locations = { "classpath:mtomTestBeans.xml" })
 public class MtomTest extends AbstractJUnit4SpringContextTests {
-    
+    static final String PORT = TestUtil.getPortNumber(MtomTest.class);
+
     private org.apache.cxf.systest.aegis.mtom.fortest.MtomTestImpl impl;
     private org.apache.cxf.systest.aegis.mtom.fortest.MtomTest client;
     private TestUtilities testUtilities;
@@ -65,7 +67,7 @@ public class MtomTest extends AbstractJU
         aegisBinding.setMtomEnabled(enableClientMTOM);
         ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
         proxyFac.setDataBinding(aegisBinding);
-        proxyFac.setAddress("http://localhost:9002/mtom");
+        proxyFac.setAddress("http://localhost:" + PORT + "/mtom");
         proxyFac.setServiceClass(org.apache.cxf.systest.aegis.mtom.fortest.MtomTest.class);
         Map<String, Object> props = new HashMap<String, Object>();
         if (enableClientMTOM) {
@@ -144,7 +146,7 @@ public class MtomTest extends AbstractJU
         String url = testUtilities.resolveNamespacePrefix(pieces[0], elementNode);
         Assert.assertEquals(SOAPConstants.XSD, url);
         
-        s = testUtilities.getServerForAddress("http://localhost:9002/mtomXmime");
+        s = testUtilities.getServerForAddress("http://localhost:" + PORT + "/mtomXmime");
         wsdl = testUtilities.getWSDLDocument(s); 
         Assert.assertNotNull(wsdl);
         typeAttrList = 

Modified: cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java Tue Jul 27 20:46:55 2010
@@ -33,6 +33,7 @@ import org.apache.cxf.systest.jaxb.model
 import org.apache.cxf.systest.jaxb.model.Widget;
 import org.apache.cxf.systest.jaxb.service.TestService;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -42,6 +43,7 @@ import org.springframework.test.context.
 
 @ContextConfiguration(locations = { "classpath:extrajaxbclass.xml" })
 public class TestServiceTest extends AbstractJUnit4SpringContextTests {
+    static final String PORT = TestUtil.getPortNumber(TestServiceTest.class);
 
     private TestUtilities testUtilities;
 
@@ -65,7 +67,7 @@ public class TestServiceTest extends Abs
         TestService testClient = getTestClient();
         ((BindingProvider)testClient).getRequestContext()
             .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
-                 "http://localhost:7081/service/TestEndpoint");
+                 "http://localhost:" + PORT + "/service/TestEndpoint");
         Widget widgetFromService = testClient.getWidgetById((long)42);
 
         Assert.assertEquals(expected, widgetFromService);
@@ -74,7 +76,7 @@ public class TestServiceTest extends Abs
     
     @Test
     public void testSchema() throws Exception {
-        URL url = new URL("http://localhost:7081/service/TestService?wsdl");
+        URL url = new URL("http://localhost:" + PORT + "/service/TestService?wsdl");
         String s = IOUtils.toString(url.openStream());
         Assert.assertTrue(s, s.contains("application/octet-stream"));
     }



Mime
View raw message