cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r499534 - in /incubator/cxf/trunk: ./ api/ api/src/main/java/org/apache/cxf/service/model/ api/src/main/java/org/apache/cxf/ws/policy/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/ws/policy/ rt/ws/policy/src/main/java/org/apache/cxf/ws/p...
Date Wed, 24 Jan 2007 19:08:41 GMT
Author: andreasmyth
Date: Wed Jan 24 11:08:37 2007
New Revision: 499534

URL: http://svn.apache.org/viewvc?view=rev&rev=499534
Log:
* Copied extensors of wsdl11:operation:[input/output] elements to associated MessageInfo.
* wsdl 1.1 policy attachment (complete now except for policies attached to fault messages).

Added:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilder.java
      - copied, changed from r499351, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/AssertionBuilder.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test16.wsdl
      - copied, changed from r499351, incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test1.wsdl
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml   (with props)
Removed:
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAttachmentManager.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/AssertionBuilder.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAttachmentManagerTest.java
Modified:
    incubator/cxf/trunk/api/pom.xml
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    incubator/cxf/trunk/pom.xml
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/ws/policy/pom.xml
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/Messages.properties
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/xml/XMLPrimitiveAssertionBuilder.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java

Modified: incubator/cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/pom.xml?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/api/pom.xml (original)
+++ incubator/cxf/trunk/api/pom.xml Wed Jan 24 11:08:37 2007
@@ -84,6 +84,10 @@
             <groupId>org.codehaus.woodstox</groupId> 
             <artifactId>wstx-asl</artifactId> 
         </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.neethi</groupId> 
+            <artifactId>neethi</artifactId> 
+        </dependency>
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java Wed Jan 24 11:08:37 2007
@@ -25,7 +25,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicReference;
 
-public abstract class AbstractPropertiesHolder {
+public abstract class AbstractPropertiesHolder implements Extensible {
     private AtomicReference<Map<String, Object>> propertyMap = new AtomicReference<Map<String, Object>>();
     private AtomicReference<Object[]> extensors = new AtomicReference<Object[]>();
     

Copied: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilder.java (from r499351, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/AssertionBuilder.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilder.java?view=diff&rev=499534&p1=incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/AssertionBuilder.java&r1=499351&p2=incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilder.java&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/AssertionBuilder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilder.java Wed Jan 24 11:08:37 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.ws.policy.builders;
+package org.apache.cxf.ws.policy;
 
 import java.util.Collection;
 

Added: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java (added)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java Wed Jan 24 11:08:37 2007
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy;
+
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.neethi.Policy;
+
+/**
+ * 
+ */
+public interface PolicyProvider {
+
+    Policy getEffectivePolicy(ServiceInfo si);
+    
+    Policy getEffectivePolicy(EndpointInfo ei);
+    
+    Policy getEffectivePolicy(BindingOperationInfo bi);
+    
+    Policy getEffectivePolicy(BindingMessageInfo bmi);
+    
+}

Propchange: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Wed Jan 24 11:08:37 2007
@@ -426,6 +426,11 @@
             </dependency>
 
             <dependency>
+                <groupId>org.apache.ws.commons.neethi</groupId>
+                <artifactId>neethi</artifactId>
+                <version>2.0</version>
+            </dependency>
+            <dependency>
                 <groupId>stax</groupId>
                 <artifactId>stax-api</artifactId>
                 <version>1.0.1</version>

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Wed Jan 24 11:08:37 2007
@@ -109,6 +109,7 @@
     @SuppressWarnings("unchecked")
     public List<ServiceInfo> buildService(Definition d) {
         DescriptionInfo description = new DescriptionInfo();
+        description.setProperty(WSDL_DEFINITION, d);
         description.setName(d.getQName());
         copyExtensors(description, d.getExtensibilityElements());
        
@@ -137,6 +138,7 @@
         DescriptionInfo description = d;
         if (null == description) {
             description = new DescriptionInfo();
+            description.setProperty(WSDL_DEFINITION, def);
             description.setName(def.getQName());
             copyExtensors(description, def.getExtensibilityElements());
         }
@@ -378,12 +380,14 @@
             MessageInfo minfo = opInfo.createMessage(input.getMessage().getQName());
             opInfo.setInput(input.getName(), minfo);
             buildMessage(minfo, input.getMessage(), paramOrder);
+            copyExtensors(minfo, input.getExtensibilityElements());
         }
         Output output = op.getOutput();
         if (output != null) {
             MessageInfo minfo = opInfo.createMessage(output.getMessage().getQName());
             opInfo.setOutput(output.getName(), minfo);
             buildMessage(minfo, output.getMessage(), paramOrder);
+            copyExtensors(minfo, output.getExtensibilityElements());
         }
         Map<?, ?> m = op.getFaults();
         for (Map.Entry<?, ?> rawentry : m.entrySet()) {

Modified: incubator/cxf/trunk/rt/ws/policy/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/pom.xml?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/policy/pom.xml Wed Jan 24 11:08:37 2007
@@ -52,28 +52,6 @@
 	    <groupId>javax.annotation</groupId>
 	    <artifactId>jsr250-api</artifactId>
 	</dependency>
-        <!--
-        <dependency>
-            <groupId>javax.xml.ws</groupId>
-            <artifactId>jaxws-api</artifactId>
-        </dependency>
-        -->
-        <!--
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax-api</artifactId>
-        </dependency>
-        -->
-        <!--
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-        </dependency>
-        -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-common-utilities</artifactId>
@@ -88,7 +66,6 @@
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-core</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java Wed Jan 24 11:08:37 2007
@@ -32,7 +32,6 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.ws.policy.builders.AssertionBuilder;
 import org.apache.neethi.Assertion;
 
 

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/Messages.properties?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/Messages.properties (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/Messages.properties Wed Jan 24 11:08:37 2007
@@ -18,7 +18,7 @@
 #    under the License.
 #
 #
+IMMUTABLE_POLICY_MODIFICATION_EXC = Attempt to modify immutable policy object.
 NO_ASSERTIONBUILDER_EXC = No assertion builder for type {0} registered.
-REMOTE_POLICY_RESOLUTION_NOT_SUPPORTED_EXC = Resolution of remote policies is not supported.
 NOT_A_POLICY_ELEMENT_EXC = Specified element is not a Policy element.
 NOT_A_POLICYREF_ELEMENT_EXC = Specified element is not a PolicyReference element.

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java Wed Jan 24 11:08:37 2007
@@ -53,9 +53,11 @@
 public class PolicyBuilder {
     
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(PolicyBuilder.class);
+ 
     private AssertionBuilderRegistry assertionBuilderRegistry;
+   
     
-    void setAssertionBuilderRegistry(AssertionBuilderRegistry abr) {
+    public void setAssertionBuilderRegistry(AssertionBuilderRegistry abr) {
         assertionBuilderRegistry = abr;        
     }
     
@@ -87,9 +89,11 @@
         
         // setting the URI value
         String uri = element.getAttribute("URI");
+        /*
         if (uri.startsWith("#")) {
             uri = element.getBaseURI() + uri;
         }
+        */
         reference.setURI(uri);
         return reference;
     }
@@ -129,14 +133,6 @@
     }
 
     private PolicyOperator processOperationElement(Element operationElement, PolicyOperator operator) {
-
-        
-        /*
-        System.out.println("Constructing policy operator from element of type: {"
-            + operationElement.getNamespaceURI() + "}" 
-            + operationElement.getLocalName());
-        }
-        */
         
         if (Constants.TYPE_POLICY == operator.getType()) {
             Policy policyOperator = (Policy)operator;
@@ -193,4 +189,5 @@
         }
         return operator;
     }
+    
 }

Added: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties Wed Jan 24 11:08:37 2007
@@ -0,0 +1,23 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+
+REMOTE_POLICY_RESOLUTION_NOT_SUPPORTED_EXC = Resolution of remote policies is not supported.
+POLICY_REFERENCE_NOT_RESOLVED_EXC = Reference to policy {0} could not be resolved.
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java Wed Jan 24 11:08:37 2007
@@ -0,0 +1,276 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.attachment.wsdl11;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import javax.wsdl.Definition;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.service.model.AbstractDescriptionElement;
+import org.apache.cxf.service.model.BindingFaultInfo;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.DescriptionInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.Extensible;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.cxf.ws.policy.PolicyException;
+import org.apache.cxf.ws.policy.PolicyProvider;
+import org.apache.cxf.wsdl11.WSDLServiceBuilder;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyReference;
+
+/**
+ * PolicyAttachmentManager provides methods to retrieve element policies and
+ * calculate effective policies based on the policy subject's scope.
+ * 
+ */
+public class Wsdl11AttachmentPolicyProvider implements PolicyProvider {
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(Wsdl11AttachmentPolicyProvider.class);
+    
+    private PolicyBuilder builder;
+    private Map<DescriptionInfo, Map<String, Policy>> resolved = 
+        new HashMap<DescriptionInfo, Map<String, Policy>>();
+    
+    
+    void setBuilder(PolicyBuilder b) {
+        builder = b;
+    }
+    
+    public Policy getEffectivePolicy(ServiceInfo si) {
+        return getElementPolicy(si);
+    }
+    
+    /**
+     * The effective policy for a WSDL endpoint policy subject includes the element policy of the 
+     * wsdl11:port element that defines the endpoint merged with the element policy of the
+     * referenced wsdl11:binding element and the element policy of the referenced wsdl11:portType
+     * element that defines the interface of the endpoint. 
+     * 
+     * @param ei the EndpointInfo object identifying the endpoint
+     * @return the effective policy
+     */
+    public Policy getEffectivePolicy(EndpointInfo ei) {
+        Policy p = getElementPolicy(ei);
+        p = p.merge(getElementPolicy(ei.getBinding()));
+        p = p.merge(getElementPolicy(ei.getInterface()));
+        
+        return p;
+    }
+
+    /**
+     * The effective policy for a WSDL operation policy subject is calculated in relation to a 
+     * specific port, and includes the element policy of the wsdl11:portType/wsdl11:operation 
+     * element that defines the operation merged with that of the corresponding 
+     * wsdl11:binding/wsdl11:operation element.
+     * 
+     * @param bi the BindingOperationInfo identifying the oeration in relation to a port
+     * @return the effective policy
+     */
+    public Policy getEffectivePolicy(BindingOperationInfo bi) {
+        DescriptionInfo di = bi.getBinding().getDescription();
+        Policy p = getElementPolicy(bi, di);
+        p = p.merge(getElementPolicy(bi.getOperationInfo(), di));
+        return p;
+    }
+    
+    /**
+     * The effective policy for a specific WSDL message (input or output) is calculated
+     * in relation to a specific port. and includes the element policy of the wsdl:message
+     * element that defines the message's type mered with the element policy of the 
+     * wsdl11:binding and wsdl11:portType message definitions that describe the message.
+     * For example, the effective policy of a specific inout message for a specific port
+     * would be the (element policies of the) wsdl11:message element defining the message type,
+     * the wsdl11:portType/wsdl11:operation/wsdl11:input element and the corresponding
+     * wsdl11:binding/wsdl11:operation/wsdl11:input element for that message.
+     * 
+     * @param bmi the BindingMessageInfo identifiying the message
+     * @return the effective policy
+     */
+    public Policy getEffectivePolicy(BindingMessageInfo bmi) {
+        ServiceInfo si = bmi.getBindingOperation().getBinding().getService();
+        DescriptionInfo di = si.getDescription();
+
+        Policy p = getElementPolicy(bmi, di);
+        p = p.merge(getElementPolicy(bmi.getMessageInfo(), di));
+
+        MessageInfo mi = bmi.getMessageInfo();
+        Extensible ex = getMessageTypeInfo(mi.getName(), di);
+  
+        p = p.merge(getElementPolicy(ex, di));
+
+        return p;
+    }
+    
+
+    
+    Policy getEffectivePolicy(BindingFaultInfo bfi) {
+        return null;
+    }
+    
+    Policy getElementPolicy(AbstractDescriptionElement adh) {
+        return getElementPolicy(adh, adh.getDescription());
+    }
+
+    Policy getElementPolicy(Extensible ex, DescriptionInfo di) {
+        
+        Policy elementPolicy = new Policy();
+        
+        if (null == ex) {
+            return elementPolicy;
+        }
+        
+        List<UnknownExtensibilityElement> extensions = 
+            ex.getExtensors(UnknownExtensibilityElement.class);
+        if (null == extensions) {
+            return elementPolicy;
+        }
+        
+        for (UnknownExtensibilityElement e : extensions) {
+            Policy p = null;
+            if (PolicyConstants.getPolicyQName().equals(e.getElementType())) {
+                p = builder.getPolicy(e.getElement());
+
+            } else if (PolicyConstants.getPolicyReferenceQName().equals(e.getElementType())) {
+                PolicyReference ref = builder.getPolicyReference(e.getElement());
+                if (null != ref) {
+                    p = resolveReference(ref, di);
+                    if (null == p) {
+                        throw new PolicyException(new Message("REMOTE_POLICY_RESOLUTION_NOT_SUPPORTED_EXC", 
+                                                              BUNDLE, ref.getURI()));
+                    }
+                }
+            }
+            if (null != p) {
+                elementPolicy = elementPolicy.merge(p);
+            }
+        }
+
+        return elementPolicy;
+    }
+    
+    
+    Policy resolveReference(PolicyReference ref, DescriptionInfo di) {
+        String uri = ref.getURI();
+        if (isExternal(ref)) {
+            return resolveExternal(ref);
+        }
+  
+        return resolveLocal(uri.substring(1), di);
+    }
+
+    Policy resolveLocal(String uri, DescriptionInfo description) {
+        Policy resolvedPolicy = null;
+        Map<String, Policy> policyMap = resolved.get(description);
+        if (null == policyMap) {
+            policyMap = new HashMap<String, Policy>();
+            resolved.put(description, policyMap);
+        } else {
+            resolvedPolicy = policyMap.get(uri);
+            if (null != resolvedPolicy) {
+                return resolvedPolicy;
+            }
+        }
+        
+        List<UnknownExtensibilityElement> extensions = 
+            description.getExtensors(UnknownExtensibilityElement.class);
+        for (UnknownExtensibilityElement e : extensions) {
+            if (PolicyConstants.getPolicyQName().equals(e.getElementType())) {
+                Policy p = builder.getPolicy(e.getElement());
+                policyMap.put(p.getId(), p);
+                if (uri.equals(p.getId())) {
+                    resolvedPolicy = p; 
+                    break;
+                }                
+            }
+        }
+        return resolvedPolicy;
+    }
+    
+    Policy resolveExternal(PolicyReference ref) {
+        throw new PolicyException(new Message("REMOTE_POLICY_RESOLUTION_NOT_SUPPORTED_EXC", BUNDLE));
+    }
+    
+    private boolean isExternal(PolicyReference ref) {
+        return !ref.getURI().startsWith("#");
+    }
+    
+    private Extensible getMessageTypeInfo(QName name, DescriptionInfo di) {
+        Definition def = (Definition)di.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
+        if (null == def) {
+            return null;
+        }
+        
+        javax.wsdl.Message m = def.getMessage(name);
+        if (null != m) {
+            List<ExtensibilityElement> extensors = 
+                CastUtils.cast(m.getExtensibilityElements(), ExtensibilityElement.class);
+            if (null != extensors) {
+                return new ExtensibleInfo(extensors);
+            }
+        }
+        return null;
+    }
+     
+    private class ExtensibleInfo implements Extensible {
+        private List<ExtensibilityElement> extensors;
+        ExtensibleInfo(List<ExtensibilityElement> e) {
+            extensors = e;
+        }
+        
+        public <T> T getExtensor(Class<T> cls) {
+            for (ExtensibilityElement e : extensors) {
+                if (cls.isInstance(e)) {
+                    return cls.cast(e);
+                }
+            }
+            return null;
+        }
+        public <T> List<T> getExtensors(Class<T> cls) {
+            if (null == extensors) {
+                return null;
+            }
+            
+            List<T> list = new ArrayList<T>(extensors.size());
+            for (ExtensibilityElement e : extensors) {
+                if (cls.isInstance(e)) {
+                    list.add(cls.cast(e));
+                }
+            }
+            return list;
+        }
+        
+    }
+   
+
+}

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java Wed Jan 24 11:08:37 2007
@@ -33,7 +33,7 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.ws.policy.builders.AssertionBuilder;
+import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/xml/XMLPrimitiveAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/xml/XMLPrimitiveAssertionBuilder.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/xml/XMLPrimitiveAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/xml/XMLPrimitiveAssertionBuilder.java Wed Jan 24 11:08:37 2007
@@ -26,7 +26,7 @@
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.ws.policy.builders.AssertionBuilder;
+import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.neethi.Assertion;
 
 public class XMLPrimitiveAssertionBuilder implements AssertionBuilder {

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java Wed Jan 24 11:08:37 2007
@@ -25,7 +25,6 @@
 
 import junit.framework.TestCase;
 
-import org.apache.cxf.ws.policy.builders.AssertionBuilder;
 import org.apache.cxf.ws.policy.builders.xml.XMLPrimitiveAssertionBuilder;
 import org.apache.neethi.Policy;
 import org.apache.neethi.util.PolicyComparator;

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java?view=diff&rev=499534&r1=499533&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java Wed Jan 24 11:08:37 2007
@@ -27,24 +27,28 @@
 import junit.framework.TestCase;
 
 import org.apache.cxf.helpers.CastUtils;
-import org.apache.cxf.ws.policy.builders.AssertionBuilder;
 import org.apache.cxf.ws.policy.builders.xml.XMLPrimitiveAssertionBuilder;
 import org.apache.neethi.Constants;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
+import org.apache.neethi.PolicyReference;
 
 public class PolicyBuilderTest extends TestCase {
     
-    public void testGetPolicy() throws Exception {
-        String name = "/samples/test25.xml";
-        InputStream is = PolicyBuilderTest.class.getResourceAsStream(name);
-        PolicyBuilder builder = new PolicyBuilder();
+    private PolicyBuilder builder;
+    
+    public void setUp() {
+        builder = new PolicyBuilder();
         AssertionBuilderRegistry abr = new AssertionBuilderRegistry();
         builder.setAssertionBuilderRegistry(abr);
         AssertionBuilder ab = new XMLPrimitiveAssertionBuilder();
         abr.registerBuilder(new QName("http://sample.org/Assertions", "A"), ab);
         abr.registerBuilder(new QName("http://sample.org/Assertions", "B"), ab);
-        abr.registerBuilder(new QName("http://sample.org/Assertions", "C"), ab);        
+        abr.registerBuilder(new QName("http://sample.org/Assertions", "C"), ab);
+    }
+    public void testGetPolicy() throws Exception {
+        String name = "/samples/test25.xml";
+        InputStream is = PolicyBuilderTest.class.getResourceAsStream(name);        
         
         Policy p = builder.getPolicy(is);
         assertNotNull(p);
@@ -53,5 +57,21 @@
         for (int i = 0; i < 3; i++) {
             assertEquals(Constants.TYPE_ASSERTION, a.get(i).getType());
         }
+    }
+    
+    public void testGetPolicyReference() throws Exception {
+        String name = "/samples/test26.xml";
+        InputStream is = PolicyBuilderTest.class.getResourceAsStream(name);        
+        
+        PolicyReference pr = builder.getPolicyReference(is);
+        assertEquals("#PolicyA", pr.getURI());
+        
+        name = "/samples/test27.xml";
+        is = PolicyBuilderTest.class.getResourceAsStream(name);        
+        
+        pr = builder.getPolicyReference(is);
+        assertEquals("http://sample.org/test.wsdl#PolicyA", pr.getURI()); 
+        
+        
     }
 }

Added: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java Wed Jan 24 11:08:37 2007
@@ -0,0 +1,376 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.attachment.wsdl11;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.WSDLException;
+import javax.xml.namespace.QName;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.ws.policy.AssertionBuilder;
+import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
+import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyException;
+import org.apache.cxf.ws.policy.builders.xml.XMLPrimitiveAssertionBuilder;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.WSDLServiceBuilder;
+import org.apache.neethi.Constants;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyComponent;
+import org.apache.neethi.util.PolicyComparator;
+
+/**
+ * 
+ */
+public class Wsdl11AttachmentPolicyProviderTest extends TestCase {
+
+    private static final String NAMESPACE_URI = "http://apache.org/cxf/calculator";
+    private static final QName OPERATION_NAME = new QName(NAMESPACE_URI, "add");
+    private static Bus bus;
+    private static ServiceInfo[] services;
+    private static EndpointInfo[] endpoints;
+    private Wsdl11AttachmentPolicyProvider app; 
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite(Wsdl11AttachmentPolicyProviderTest.class);
+        TestSetup wrapper = new TestSetup(suite) {
+
+            protected void setUp() {
+                oneTimeSetUp();
+            }
+
+            protected void tearDown() {
+                oneTimeTearDown();
+            }
+        };
+
+        return wrapper;
+    }
+    
+    public static void oneTimeSetUp() {
+        bus = new SpringBusFactory().getDefaultBus();
+        WSDLManager manager = bus.getExtension(WSDLManager.class);
+        int n = 17;
+        services = new ServiceInfo[n];
+        endpoints = new EndpointInfo[n];
+        for (int i = 0; i < n; i++) {
+            String resourceName = "/attachment/wsdl11/test" + i + ".wsdl";
+            URL url = Wsdl11AttachmentPolicyProviderTest.class.getResource(resourceName);       
+            WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
+            try {
+                services[i] = builder.buildService(manager.getDefinition(url)).get(0);
+            } catch (WSDLException ex) {
+                ex.printStackTrace();
+                fail("Failed to build service from resource " + resourceName);
+            }
+            assertNotNull(services[i]);
+            endpoints[i] = services[i].getEndpoints().iterator().next();
+            assertNotNull(endpoints[i]);
+        }
+    }
+    
+    public static void oneTimeTearDown() {
+        bus.shutdown(true);
+        new SpringBusFactory().setDefaultBus(null);
+        endpoints = null;
+        services = null;
+        
+    }
+    
+    public void setUp() {
+        AssertionBuilderRegistry abr = bus.getExtension(AssertionBuilderRegistry.class);
+        assertNotNull(abr);
+        AssertionBuilder ab = new XMLPrimitiveAssertionBuilder();
+        abr.registerBuilder(new QName("http://cxf.apache.org/test/assertions", "A"), ab);
+        abr.registerBuilder(new QName("http://cxf.apache.org/test/assertions", "B"), ab);
+        abr.registerBuilder(new QName("http://cxf.apache.org/test/assertions", "C"), ab);
+        
+        PolicyBuilder pb = new PolicyBuilder(); 
+        pb.setAssertionBuilderRegistry(abr);
+        app = new Wsdl11AttachmentPolicyProvider();
+        app.setBuilder(pb);
+        
+    }
+    
+    public void testElementPolicies() throws WSDLException {
+    
+        Policy p;
+        
+        // no extensions       
+        p = app.getElementPolicy(services[0]);
+        assertNotNull(p);
+        assertTrue(p.isEmpty());
+        
+        // extensions not of type Policy or PolicyReference
+        p = app.getElementPolicy(services[1]);
+        assertNotNull(p);
+        assertTrue(p.isEmpty());
+        
+        // one extension of type Policy, without assertion builder
+        try {
+            p = app.getElementPolicy(services[2]);
+            fail("Expected PolicyException not thrown.");
+        } catch (PolicyException ex) {
+            // expected
+        }
+        
+        // one extension of type Policy
+        p = app.getElementPolicy(services[3]);
+        assertNotNull(p);
+        assertTrue(!p.isEmpty());
+        verifyAssertionsOnly(p, 2);
+        
+        // two extensions of type Policy
+        p = app.getElementPolicy(services[4]);
+        assertNotNull(p);
+        assertTrue(!p.isEmpty());
+        verifyAssertionsOnly(p, 3);
+        
+        EndpointInfo ei = new EndpointInfo();
+        assertTrue(app.getElementPolicy(ei).isEmpty());
+    }
+    
+    public void testEffectiveServicePolicies() throws WSDLException {
+        
+        Policy p;
+        Policy ep;
+        
+        // no extensions        
+        ep = app.getEffectivePolicy(services[0]);
+        assertNotNull(ep);
+        assertTrue(ep.isEmpty());
+        p = app.getElementPolicy(services[0]);
+        assertTrue(PolicyComparator.compare(p, ep));
+        
+        // extensions not of type Policy or PolicyReference
+        ep = app.getEffectivePolicy(services[1]);
+        assertNotNull(ep);
+        assertTrue(ep.isEmpty());
+        
+        // one extension of type Policy, without assertion builder
+        try {
+            ep = app.getEffectivePolicy(services[2]);
+            fail("Expected PolicyException not thrown.");
+        } catch (PolicyException ex) {
+            // expected
+        }
+        
+        // one extension of type Policy
+        ep = app.getEffectivePolicy(services[3]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 2);
+        p = app.getElementPolicy(services[3]);
+        assertTrue(PolicyComparator.compare(p, ep));
+        
+        // two extensions of type Policy
+        ep = app.getEffectivePolicy(services[4]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 3);
+        p = app.getElementPolicy(services[4]);
+        assertTrue(PolicyComparator.compare(p, ep));
+    }
+
+    public void testEffectiveEndpointPolicies() {
+        Policy ep;
+        Policy p;
+        
+        // port has no extensions
+        // porttype has no extensions
+        // binding has no extensions
+        ep = app.getEffectivePolicy(endpoints[0]);
+        assertNotNull(ep);
+        assertTrue(ep.isEmpty());
+        
+        // port has one extension of type Policy        
+        // binding has no extensions
+        // porttype has no extensions
+        ep = app.getEffectivePolicy(endpoints[5]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        p = app.getElementPolicy(endpoints[5]);
+        assertTrue(PolicyComparator.compare(p, ep));
+        
+        // port has no extensions
+        // binding has one extension of type Policy
+        // porttype has no extensions
+        ep = app.getEffectivePolicy(endpoints[6]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        p = app.getElementPolicy(endpoints[6].getBinding());
+        assertTrue(PolicyComparator.compare(p, ep));
+        
+        // port has no extensions
+        // binding has no extensions
+        // porttype has one extension of type Policy
+        ep = app.getEffectivePolicy(endpoints[7]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        p = app.getElementPolicy(endpoints[7].getInterface());
+        assertTrue(PolicyComparator.compare(p, ep));
+        
+        // port has one extension of type Policy
+        // porttype has one extension of type Policy
+        // binding has one extension of type Policy
+        ep = app.getEffectivePolicy(endpoints[8]);
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 3);
+        
+    }
+    
+    public void testEffectiveBindingOperationPolicies() {
+        Policy ep;
+        
+        // operation has no extensions
+        // binding operation has no extensions
+        ep = app.getEffectivePolicy(getBindingOperationInfo(endpoints[0]));
+        assertNotNull(ep);
+        assertTrue(ep.isEmpty());
+        
+        // operation has no extensions
+        // binding operation has one extension of type Policy
+        ep = app.getEffectivePolicy(getBindingOperationInfo(endpoints[9]));
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        
+        // operation has one extension of type Policy
+        // binding operation has no extensions
+        ep = app.getEffectivePolicy(getBindingOperationInfo(endpoints[10]));
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 2);
+        
+        // operation has one extension of type Policy
+        // binding operation one extension of type Policy
+        ep = app.getEffectivePolicy(getBindingOperationInfo(endpoints[11]));
+        assertNotNull(ep);
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 3);
+    }
+    
+    public void testEffectiveMessagePolicies() {
+        Policy ep;
+        
+        // binding operation message has no extensions
+        // operation message has no extensions
+        // message has no extensions
+        ep = app.getEffectivePolicy(getBindingMessageInfo(endpoints[0], true));
+        assertNotNull(ep);
+        assertTrue(ep.isEmpty());
+        
+        // binding operation message has one extension of type Policy
+        // operation message has no extensions
+        // message has no extensions
+        ep = app.getEffectivePolicy(getBindingMessageInfo(endpoints[12], true));
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        
+        // binding operation message has no extensions
+        // operation message has one extension of type Policy
+        // message has no extensions  
+        ep = app.getEffectivePolicy(getBindingMessageInfo(endpoints[13], true));
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        
+        // binding operation message has no extensions
+        // operation message has no extensions
+        // message has one extension of type Policy
+        ep = app.getEffectivePolicy(getBindingMessageInfo(endpoints[14], true));
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 1);
+        
+        // binding operation message has one extension of type Policy
+        // operation message has one extension of type Policy
+        // message has one extension of type Policy
+        ep = app.getEffectivePolicy(getBindingMessageInfo(endpoints[15], true));
+        assertTrue(!ep.isEmpty());
+        verifyAssertionsOnly(ep, 3);      
+    }
+    
+    public void testResolveLocal() {
+        
+        Policy ep;
+        
+        // service has one extension of type PolicyReference, reference can be resolved locally
+        ep = app.getElementPolicy(services[16]);
+        assertNotNull(ep);
+        verifyAssertionsOnly(ep, 2);
+        
+        // port has one extension of type PolicyReference, reference cannot be resolved locally
+        try {
+            app.getElementPolicy(endpoints[16]);
+            fail("Expected PolicyException not thrown.");
+        } catch (PolicyException ex) {
+            // expected
+        }
+        
+        // binding has one extension of type PolicyReference, reference is external
+        try {
+            app.getElementPolicy(endpoints[16].getBinding());
+            fail("Expected PolicyException not thrown.");
+        } catch (PolicyException ex) {
+            // expected
+        }
+        
+    }
+    
+    public void testResolveExternal() {
+        
+    }
+    
+    private void verifyAssertionsOnly(Policy p, int expectedAssertions) {
+        List<PolicyComponent> pcs;
+        pcs = CastUtils.cast(p.getAssertions(), PolicyComponent.class);
+        assertEquals(expectedAssertions, pcs.size());
+        for (int i = 0; i < expectedAssertions; i++) {
+            assertEquals(Constants.TYPE_ASSERTION, pcs.get(i).getType());
+        }
+    }
+    
+    private BindingOperationInfo getBindingOperationInfo(EndpointInfo ei) {
+        return ei.getBinding().getOperation(OPERATION_NAME);        
+    }
+    
+    private BindingMessageInfo getBindingMessageInfo(EndpointInfo ei, boolean in) {
+        return in ? ei.getBinding().getOperation(OPERATION_NAME).getInput()
+            : ei.getBinding().getOperation(OPERATION_NAME).getOutput();
+    }
+    
+    
+}

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <types>
+	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		    elementFormDefault="qualified" 
+		    targetNamespace="http://apache.org/cxf/calculator/types">
+
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse" />
+
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="xsd:int" />
+		    <element name="arg1" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="add" type="x1:addNumbers" />
+
+	    <element name="CalculatorFault" type="x1:CalculatorFault" />
+	    <complexType name="CalculatorFault">
+		<sequence>
+		    <element name="faultInfo" type="xsd:string" />
+		    <element name="message" type="xsd:string" />
+		</sequence>
+	    </complexType>
+	</xsd:schema>
+    </types>
+    <message name="add">
+	<part name="parameters" element="x1:add" />
+    </message>
+    <message name="addNumbersResponse">
+	<part name="result" element="x1:addNumbersResponse" />
+    </message>
+    <message name="addNumbersFault">
+	<part name="CalculatorFault" element="x1:CalculatorFault" />
+    </message>
+
+    <portType name="CalculatorPortType">
+	<operation name="add">
+	    <wsp:Policy>
+            <ta:B>B</ta:B>  
+            <ta:C>C</ta:C>
+        </wsp:Policy>
+	    <input message="tns:add"/>
+	    <output message="tns:addNumbersResponse"/>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault"/>
+	</operation>
+    </portType>
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <soap12:operation soapAction="" />
+	    <input>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">
+	<port name="CalculatorPort" binding="tns:CalculatorBinding">
+	    <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />
+	</port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test10.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <types>
+	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		    elementFormDefault="qualified" 
+		    targetNamespace="http://apache.org/cxf/calculator/types">
+
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse" />
+
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="xsd:int" />
+		    <element name="arg1" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="add" type="x1:addNumbers" />
+
+	    <element name="CalculatorFault" type="x1:CalculatorFault" />
+	    <complexType name="CalculatorFault">
+		<sequence>
+		    <element name="faultInfo" type="xsd:string" />
+		    <element name="message" type="xsd:string" />
+		</sequence>
+	    </complexType>
+	</xsd:schema>
+    </types>
+    <message name="add">
+	<part name="parameters" element="x1:add" />
+    </message>
+    <message name="addNumbersResponse">
+	<part name="result" element="x1:addNumbersResponse" />
+    </message>
+    <message name="addNumbersFault">
+	<part name="CalculatorFault" element="x1:CalculatorFault" />
+    </message>
+
+    <portType name="CalculatorPortType">
+	<operation name="add">
+	    <wsp:Policy>
+            <ta:B>B</ta:B>  
+            <ta:C>C</ta:C>
+        </wsp:Policy>
+	    <input message="tns:add"/>
+	    <output message="tns:addNumbersResponse"/>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault"/>
+	</operation>
+    </portType>
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <wsp:Policy>
+            <ta:A>A</ta:A>  
+        </wsp:Policy>
+	    <soap12:operation soapAction="" />
+	    <input>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">
+	<port name="CalculatorPort" binding="tns:CalculatorBinding">
+	    <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />
+	</port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test11.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
+
+    <import namespace="http://apache.org/cxf/calculator"
+       location="calculator-abstract.wsdl" />
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <soap12:operation soapAction="" />
+	    <input>
+	    <wsp:Policy>
+            <ta:A>A</ta:A>  
+        </wsp:Policy>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+	    <wsp:Policy>
+            <ta:C>C</ta:C>  
+        </wsp:Policy>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">        
+        <port name="CalculatorPort" binding="tns:CalculatorBinding">
+	        <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" /> 	                   
+	    </port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test12.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <types>
+	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		    elementFormDefault="qualified" 
+		    targetNamespace="http://apache.org/cxf/calculator/types">
+
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse" />
+
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="xsd:int" />
+		    <element name="arg1" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="add" type="x1:addNumbers" />
+
+	    <element name="CalculatorFault" type="x1:CalculatorFault" />
+	    <complexType name="CalculatorFault">
+		<sequence>
+		    <element name="faultInfo" type="xsd:string" />
+		    <element name="message" type="xsd:string" />
+		</sequence>
+	    </complexType>
+	</xsd:schema>
+    </types>
+    <message name="add">
+	<part name="parameters" element="x1:add" />
+    </message>
+    <message name="addNumbersResponse">
+	<part name="result" element="x1:addNumbersResponse" />
+    </message>
+    <message name="addNumbersFault">
+	<part name="CalculatorFault" element="x1:CalculatorFault" />
+    </message>
+
+    <portType name="CalculatorPortType">
+	<operation name="add">	    
+	    <input message="tns:add">
+	        <wsp:Policy>
+                <ta:B>B</ta:B>  
+            </wsp:Policy>
+	    </input>
+	    <output message="tns:addNumbersResponse">
+	        <wsp:Policy>
+                <ta:B>B</ta:B>  
+            </wsp:Policy>
+	    </output>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault"/>
+	</operation>
+    </portType>
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <soap12:operation soapAction="" />
+	    <input>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">
+	<port name="CalculatorPort" binding="tns:CalculatorBinding">
+	    <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />
+	</port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test13.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <types>
+	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		    elementFormDefault="qualified" 
+		    targetNamespace="http://apache.org/cxf/calculator/types">
+
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse" />
+
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="xsd:int" />
+		    <element name="arg1" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="add" type="x1:addNumbers" />
+
+	    <element name="CalculatorFault" type="x1:CalculatorFault" />
+	    <complexType name="CalculatorFault">
+		<sequence>
+		    <element name="faultInfo" type="xsd:string" />
+		    <element name="message" type="xsd:string" />
+		</sequence>
+	    </complexType>
+	</xsd:schema>
+    </types>
+    <message name="add">
+    <wsp:Policy>
+        <ta:C>C</ta:C>  
+    </wsp:Policy>
+	<part name="parameters" element="x1:add" />
+    </message>
+    <message name="addNumbersResponse">
+	<part name="result" element="x1:addNumbersResponse" />
+	<wsp:Policy>
+        <ta:A>A</ta:A>  
+    </wsp:Policy>
+    </message>
+    <message name="addNumbersFault">
+	<part name="CalculatorFault" element="x1:CalculatorFault" />
+    </message>
+
+    <portType name="CalculatorPortType">
+	<operation name="add">	    
+	    <input message="tns:add"/>
+	    <output message="tns:addNumbersResponse"/>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault"/>
+	</operation>
+    </portType>
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <soap12:operation soapAction="" />
+	    <input>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">
+	<port name="CalculatorPort" binding="tns:CalculatorBinding">
+	    <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />
+	</port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test14.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <types>
+	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		    elementFormDefault="qualified" 
+		    targetNamespace="http://apache.org/cxf/calculator/types">
+
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse" />
+
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="xsd:int" />
+		    <element name="arg1" type="xsd:int" />
+		</sequence>
+	    </complexType>
+	    <element name="add" type="x1:addNumbers" />
+
+	    <element name="CalculatorFault" type="x1:CalculatorFault" />
+	    <complexType name="CalculatorFault">
+		<sequence>
+		    <element name="faultInfo" type="xsd:string" />
+		    <element name="message" type="xsd:string" />
+		</sequence>
+	    </complexType>
+	</xsd:schema>
+    </types>
+    <message name="add">
+    <wsp:Policy>
+        <ta:C>C</ta:C>  
+    </wsp:Policy>
+	<part name="parameters" element="x1:add" />
+    </message>
+    <message name="addNumbersResponse">
+	<part name="result" element="x1:addNumbersResponse" />
+	<wsp:Policy>
+        <ta:A>A</ta:A>  
+    </wsp:Policy>
+    </message>
+    <message name="addNumbersFault">
+	<part name="CalculatorFault" element="x1:CalculatorFault" />
+    </message>
+
+    <portType name="CalculatorPortType">
+	<operation name="add">	    
+	    <input message="tns:add">
+	        <wsp:Policy>
+	            <ta:B>B</ta:B>
+	        </wsp:Policy>
+	    </input>
+	    <output message="tns:addNumbersResponse">
+	        <wsp:Policy>
+	            <ta:B>B</ta:B>
+	        </wsp:Policy>
+	    </output>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault"/>
+	</operation>
+    </portType>
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <soap12:operation soapAction="" />
+	    <input>
+	    <wsp:Policy>
+	        <ta:A>A</ta:A>
+	    </wsp:Policy>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+		<wsp:Policy>
+	        <ta:C>C</ta:C>
+	    </wsp:Policy>
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">
+	<port name="CalculatorPort" binding="tns:CalculatorBinding">
+	    <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />
+	</port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test15.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test16.wsdl (from r499351, incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test1.wsdl)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test16.wsdl?view=diff&rev=499534&p1=incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test1.wsdl&r1=499351&p2=incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test16.wsdl&r2=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test1.wsdl (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test16.wsdl Wed Jan 24 11:08:37 2007
@@ -31,6 +31,15 @@
     xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
 
+    <wsp:Policy wsu:Id="PolicyA">
+        <ta:A>A</ta:A>
+        <ta:B>B></ta:B>
+    </wsp:Policy>
+    
+    <wsp:Policy wsu:Id="PolicyC">
+        <ta:C>C</ta:C>
+    </wsp:Policy>
+    
     <import namespace="http://apache.org/cxf/calculator"
        location="calculator-abstract.wsdl" />
 
@@ -48,12 +57,13 @@
 		<soap12:fault name="addNumbersFault" use="literal" />
 	    </fault>
 	</operation>
+	<wsp:PolicyReference URI="http://example.org/test.wsdl#PolicyC"/>
     </binding>
 
     <service name="CalculatorService">
-        <ta:A>A</ta:A> 
-        <ta:B>B</ta:B> 
+        <wsp:PolicyReference URI="#PolicyA"/>
         <port name="CalculatorPort" binding="tns:CalculatorBinding">
+            <wsp:PolicyReference URI="#PolicyB"/>
 	        <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" />            
 	    </port>
     </service>

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl Wed Jan 24 11:08:37 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions name="Calculator"  
+    targetNamespace="http://apache.org/cxf/calculator"
+    xmlns:tns="http://apache.org/cxf/calculator"
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:x1="http://apache.org/cxf/calculator/types"
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+    xmlns:ta="http://cxf.apache.org/test/assertions"
+    xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
+
+    <import namespace="http://apache.org/cxf/calculator"
+       location="calculator-abstract.wsdl" />
+
+    <binding name="CalculatorBinding" type="tns:CalculatorPortType">
+	<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+	<operation name="add">
+	    <wsp:Policy>
+            <ta:A>A</ta:A>  
+        </wsp:Policy> 
+	    <soap12:operation soapAction="" />
+	    <input>
+		<soap12:body use="literal" />
+	    </input>
+	    <output>
+		<soap12:body use="literal" />
+	    </output>
+	    <fault name="addNumbersFault">
+		<soap12:fault name="addNumbersFault" use="literal" />
+	    </fault>
+	</operation>
+    </binding>
+
+    <service name="CalculatorService">        
+        <port name="CalculatorPort" binding="tns:CalculatorBinding">
+	        <soap12:address location="http://localhost:9000/CalculatorService/SoapPort" /> 	                  
+	    </port>
+    </service>
+
+</definitions>

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/attachment/wsdl11/test9.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml Wed Jan 24 11:08:37 2007
@@ -0,0 +1,2 @@
+<wsp:PolicyReference URI="#PolicyA" 
+	xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"/>
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test26.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml?view=auto&rev=499534
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml Wed Jan 24 11:08:37 2007
@@ -0,0 +1,2 @@
+<wsp:PolicyReference URI="http://sample.org/test.wsdl#PolicyA" 
+	xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"/>
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/policy/src/test/resources/samples/test27.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message