You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2011/05/24 10:25:30 UTC

svn commit: r1126922 - in /cxf/branches/2.3.x-fixes: ./ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/ systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/

Author: ema
Date: Tue May 24 08:25:29 2011
New Revision: 1126922

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

........
  r1126906 | ema | 2011-05-24 15:39:24 +0800 (Tue, 24 May 2011) | 1 line
  
  [CXF-3544]:Fix nested policy can not be resolved issue
........

Added:
    cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java
      - copied unchanged from r1126906, cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java
    cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http-addr-server.xml
      - copied unchanged from r1126906, cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http-addr-server.xml
    cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_server_greeter_addr.wsdl
      - copied unchanged from r1126906, cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_server_greeter_addr.wsdl
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 24 08:25:29 2011
@@ -1 +1 @@
-/cxf/trunk:1099767,1100898,1101399,1102198,1103904,1104144,1104180,1104217,1104230,1124357,1125115,1125289,1125323
+/cxf/trunk:1099767,1100898,1101399,1102198,1103904,1104144,1104180,1104217,1104230,1124357,1125115,1125289,1125323,1126906

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

Modified: cxf/branches/2.3.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java?rev=1126922&r1=1126921&r2=1126922&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java (original)
+++ cxf/branches/2.3.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java Tue May 24 08:25:29 2011
@@ -31,6 +31,7 @@ import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.AbstractDescriptionElement;
 import org.apache.cxf.service.model.BindingFaultInfo;
@@ -169,9 +170,31 @@ public class Wsdl11AttachmentPolicyProvi
         if (null == ex || null == di) {
             return null;
         }
+        
+        if (di.getProperty("registeredPolicy") == null) {
+            List<UnknownExtensibilityElement> diext = 
+                di.getExtensors(UnknownExtensibilityElement.class);
+            if (diext != null) {
+                for (UnknownExtensibilityElement e : diext) {
+                    String uri = e.getElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
+                                                  PolicyConstants.WSU_ID_ATTR_NAME);
+                    
+                    if (PolicyConstants.isPolicyElem(e.getElementType())
+                        && !StringUtils.isEmpty(uri)) {
+                        Policy policy = builder.getPolicy(e.getElement());
+                        String fragement = "#" + uri;
+                        registry.register(fragement, policy);
+                        registry.register(di.getBaseURI() + fragement, policy);
+                    }
+                }
+            }
+            di.setProperty("registeredPolicy", true);
+        }
+        
         Policy elementPolicy = null;
         List<UnknownExtensibilityElement> extensions = 
             ex.getExtensors(UnknownExtensibilityElement.class);
+        
         if (null != extensions) {
             for (UnknownExtensibilityElement e : extensions) {
                 Policy p = null;
@@ -242,6 +265,7 @@ public class Wsdl11AttachmentPolicyProvi
         if (null != resolved) {
             return resolved;
         }
+        
         ReferenceResolver resolver = new LocalServiceModelReferenceResolver(di, builder);
         resolved = resolver.resolveReference(uri);
         if (null != resolved) {