[ 
https://issues.apache.org/jira/browse/CXF-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638626#action_12638626
 ] 

Fred Dushin commented on CXF-1849:
----------------------------------

Thanks, Dan!

The merge back to the 2.1 fixes branch looks like it should be without 
conflict.  Should I submit a patch for that?  Or is there a different process 
for back-merging?

/work/src/apache/cxf/branches/2.1.x-fixes> svn diff -r 703557 
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationOutInterceptor.java
===================================================================
--- 
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationOutInterceptor.java
   (revision 703557)
+++ 
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationOutInterceptor.java
   (working copy)
@@ -63,32 +63,10 @@
         if (policy == null) {
             return;
         }
-
-        // CXF-1849 Log a message at FINE level if policy verification fails
-        // on the outbound-server side of a response
-        try {
-            aim.checkEffectivePolicy(policy.getPolicy());
-        } catch (final PolicyException e) {
-            if (isOutboundServer(message)) {
-                LOG.fine("An exception was thrown when verifying that the 
effective policy for "
-                         + "this request was satisfied.  However, this 
exception will not result in "
-                         + "a fault.  The exception raised is: "
-                         + e.toString());
-                return;
-            } else {
-                throw e;
-            }
-        }
+        
+        aim.checkEffectivePolicy(policy.getPolicy());
+        
         LOG.fine("Verified policies for outbound message.");
     }
-    
-    private boolean isOutboundServer(final Message message) {
-        final Object role = message.get(Message.REQUESTOR_ROLE);
-        final boolean isClient =
-            role != null ? Boolean.TRUE.equals(role) : false;
-        final boolean isOutbound =
-            message == message.getExchange().getOutMessage()
-            || message == message.getExchange().getOutFaultMessage();
-        return !isClient && isOutbound;
-    }
+
 }



> PolicyVerificationOutInterceptor writes faults at wrong phase when processing 
> response
> --------------------------------------------------------------------------------------
>
>                 Key: CXF-1849
>                 URL: https://issues.apache.org/jira/browse/CXF-1849
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.1.2
>            Reporter: Fred Dushin
>            Assignee: Daniel Kulp
>             Fix For: 2.1.3, 2.2
>
>         Attachments: CXF-1849-trunk-r703513.patch
>
>
> When a CXF response is processed on an endpoint that contains policy 
> assertions (via spring, WSDL, etc), and the policy assertions are not marked 
> as asserted, the PolicyVerificationOutInterceptor properly raises a SOAP 
> fault.  However, this interceptor is inserted into the "post-stream" phase, 
> and it seems as though the fault gets written to the SOAP body after the 
> business logic has been written.
> So a response in this scenario will come out as follows:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>   <soap:Body>
>      <sayHiResponse xmlns="...">
>        <responseType>Bonjou</responseType>
>      </sayHiResponse>
>      <soap:Fault>
>        <faultcode>soap:Server</faultcode>
>        <faultstring>These policy alternatives can not be satisfied: 
> [snip]</faultstring >
>     </soap:Fault>
>   </soap:Body>
> </soap:Envelope>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to