cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r692499 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/feature/LoggingFeature.java ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Date Fri, 05 Sep 2008 17:48:52 GMT
Author: dkulp
Date: Fri Sep  5 10:48:52 2008
New Revision: 692499

URL: http://svn.apache.org/viewvc?rev=692499&view=rev
Log:
Don't put the logging interceptor on the fault in as the normal in takes care of it before
it's known to be a fault.
If the soap message is a fault and the security stuff wasn't found, let the fault propogate.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java?rev=692499&r1=692498&r2=692499&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java Fri Sep  5
10:48:52 2008
@@ -49,14 +49,12 @@
     protected void initializeProvider(InterceptorProvider provider, Bus bus) {
         if (limit == DEFAULT_LIMIT) {
             provider.getInInterceptors().add(IN);
-            provider.getInFaultInterceptors().add(IN);
             provider.getOutInterceptors().add(OUT);
             provider.getOutFaultInterceptors().add(OUT);
         } else {
             LoggingInInterceptor in = new LoggingInInterceptor(limit);
             LoggingOutInterceptor out = new LoggingOutInterceptor(limit);
             provider.getInInterceptors().add(in);
-            provider.getInFaultInterceptors().add(in);
             provider.getOutInterceptors().add(out);
             provider.getOutFaultInterceptors().add(out);
         }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=692499&r1=692498&r2=692499&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Fri Sep  5 10:48:52 2008
@@ -99,13 +99,17 @@
         }
     }
 
-    public void handleMessage(SoapMessage msg) throws Fault {
+    private SOAPMessage getSOAPMessage(SoapMessage msg) {
         SOAPMessage doc = msg.getContent(SOAPMessage.class);
         if (doc == null) {
             saajIn.handleMessage(msg);
             doc = msg.getContent(SOAPMessage.class);
         }
-        
+        return doc;
+    }
+    
+    public void handleMessage(SoapMessage msg) throws Fault {
+        SOAPMessage doc = getSOAPMessage(msg);
         
         boolean doDebug = LOG.isLoggable(Level.FINE);
         boolean doTimeLog = TIME_LOG.isLoggable(Level.FINE);
@@ -168,6 +172,10 @@
             if (wsResult == null) { // no security header found
                 if (doAction == WSConstants.NO_SECURITY) {
                     return;
+                } else if (doc.getSOAPPart().getEnvelope().getBody().hasFault()) {
+                    LOG.warning("Request does not contain required Security header, " 
+                                + "but it's a fault.");
+                    return;
                 } else {
                     LOG.warning("Request does not contain required Security header");
                     throw new WSSecurityException(WSSecurityException.INVALID_SECURITY);



Mime
View raw message