cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r965480 - in /cxf/branches/2.2.x-fixes: ./ rt/ws/policy/pom.xml rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java
Date Mon, 19 Jul 2010 13:49:38 GMT
Author: dkulp
Date: Mon Jul 19 13:49:38 2010
New Revision: 965480

URL: http://svn.apache.org/viewvc?rev=965480&view=rev
Log:
Merged revisions 959535 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r959535 | ema | 2010-07-01 02:45:35 -0400 (Thu, 01 Jul 2010) | 1 line
  
  [CXF-2850]:Throw Message Addressing property is not present exception when the wsa policy
is violated
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/policy/pom.xml
    cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java

Propchange: cxf/branches/2.2.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/pom.xml?rev=965480&r1=965479&r2=965480&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/pom.xml Mon Jul 19 13:49:38 2010
@@ -55,6 +55,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>

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java?rev=965480&r1=965479&r2=965480&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java
Mon Jul 19 13:49:38 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.");
     }
 



Mime
View raw message