[jbossws-commits] JBossWS SVN: r10198 - in stack/native/branches/jbossws-native-3.1.2/modules: core/src/main/java/org/jboss/ws/extensions/wsrm and 12 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jun 16 08:41:21 EDT 2009


Author: alessio.soldano at jboss.com
Date: 2009-06-16 08:41:21 -0400 (Tue, 16 Jun 2009)
New Revision: 10198

Removed:
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/policy/
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/policy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wspolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/jbws1645/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachment.wsdl
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/samples/wssecuritypolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/wspolicy/
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/tools/jbws1645/
Modified:
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsconsume.xml
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsprovide.xml
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
   stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
Log:
[JBPAPP-1902] Removing ws-policy


Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -23,7 +23,9 @@
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 import javax.jws.soap.SOAPBinding;
 import javax.xml.namespace.QName;
@@ -31,9 +33,9 @@
 
 import org.jboss.ws.Constants;
 import org.jboss.ws.WSException;
+import org.jboss.ws.annotation.EndpointConfig;
 import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
 import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
 import org.jboss.ws.extensions.wsrm.common.RMHelper;
 import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -56,7 +58,6 @@
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-import org.jboss.ws.annotation.EndpointConfig;
 
 /**
  * A client side meta data builder.
@@ -85,13 +86,6 @@
 
          buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
 
-         //Setup policies for each endpoint
-         for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
-         {
-            PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getClientSidePolicyMetaDataBuilder();
-            policyBuilder.processPolicyExtensions(epMetaData, wsdlDefinitions);
-         }
-         
          // Read the WSDL and initialize the schema model
          // This should only be needed for debuging purposes of the UMDM
          JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());

Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -36,8 +36,6 @@
 import org.jboss.ws.Constants;
 import org.jboss.ws.WSException;
 import org.jboss.ws.annotation.Documentation;
-import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
-import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
 import org.jboss.ws.metadata.builder.MetaDataBuilder;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
@@ -52,7 +50,6 @@
 import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
 import org.jboss.ws.tools.ToolsUtils;
 import org.jboss.ws.tools.wsdl.JAXBWSDLGenerator;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
 import org.jboss.ws.tools.wsdl.WSDLGenerator;
 import org.jboss.ws.tools.wsdl.WSDLWriter;
 import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
@@ -154,13 +151,6 @@
          createJAXBContext(sepMetaData);
          populateXmlTypes(sepMetaData);
 
-         //Process an optional @PolicyAttachment annotation
-         if (sepClass.isAnnotationPresent(PolicyAttachment.class))
-         {
-            PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
-            policyBuilder.processPolicyAnnotations(sepMetaData, sepClass);
-         }
-
          // The server must always generate WSDL
          if (generateWsdl || !toolMode)
             processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);
@@ -374,19 +364,11 @@
 
    private void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, URL wsdlLocation, EndpointMetaData epMetaData)
    {
-      PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
       try
       {
          WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
-         WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
          if (wsdlLocation != null)
          {
-            //we can no longer use the user provided wsdl without parsing it right now, since we
-            //need to look for policies and eventually choose the supported policy alternatives
-            WSDLDefinitions wsdlDefinitions = factory.parse(wsdlLocation);
-            policyBuilder.processPolicyExtensions(epMetaData, wsdlDefinitions);
-            //now we have the UMDM containing policy data; anyway we can't write a new wsdl file with
-            //the supported alternatives and so on, since we need to publish the file the user provided
             serviceMetaData.setWsdlLocation(wsdlLocation);
          }
          else

Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -318,7 +318,6 @@
          {
             UnknownExtensibilityElement uee = (UnknownExtensibilityElement)extElement;
             boolean understood = false;
-            understood = understood || processPolicyElements(uee, dest);
             understood = understood || processUseAddressing(uee, dest);
             //add processing of further extensibility element types below
             
@@ -331,41 +330,6 @@
    }
 
    /**
-    * Process the provided extensibility element looking for policies or policy references.
-    * Returns true if the provided element is policy related, false otherwise.
-    * 
-    * @param extElement
-    * @param dest
-    * @return
-    */
-   private boolean processPolicyElements(UnknownExtensibilityElement extElement, Extendable dest)
-   {
-      boolean result = false;
-      Element srcElement = extElement.getElement();
-      if (Constants.URI_WS_POLICY.equals(srcElement.getNamespaceURI()))
-      {
-         //copy missing namespaces from the source element to our element
-         Element element = (Element)srcElement.cloneNode(true);
-         copyMissingNamespaceDeclarations(element, srcElement);
-         if (element.getLocalName().equals("Policy"))
-         {
-            WSDLExtensibilityElement el = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY, element);
-            el.setRequired("true".equalsIgnoreCase(element.getAttribute("required")));
-            dest.addExtensibilityElement(el);
-            result = true;
-         }
-         else if (element.getLocalName().equals("PolicyReference"))
-         {
-            WSDLExtensibilityElement el = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element);
-            el.setRequired("true".equalsIgnoreCase(element.getAttribute("required")));
-            dest.addExtensibilityElement(el);
-            result = true;
-         }
-      }
-      return result;
-   }
-   
-   /**
     * Process the provided extensibility element looking for UsingAddressing.
     * Returns true if the provided element is UsingAddressing, false otherwise.
     * 
@@ -713,13 +677,6 @@
       {
          WSDLInterface destInterface = new WSDLInterface(destWsdl, qname);
 
-         //policy extensions
-         QName policyURIsProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSP_POLICYURIS);
-         if (policyURIsProp != null && !"".equalsIgnoreCase(policyURIsProp.getLocalPart()))
-         {
-            destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_POLICYURIS, policyURIsProp.getLocalPart()));
-         }
-
          // documentation
          Element documentationElement = srcPortType.getDocumentationElement();
          if (documentationElement != null && documentationElement.getTextContent() != null)

Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -45,13 +45,11 @@
 import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
 import org.jboss.ws.metadata.wsdl.WSDLImport;
 import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceMessageReference;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
 import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
 import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
 import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
@@ -184,21 +182,11 @@
    {
       for (WSDLExtensibilityElement ext : extendable.getAllExtensibilityElements())
       {
-         appendPolicyElements(builder, ext);
          appendJAXWSCustomizationElements(builder, ext);
          //add processing of further extensibility element types below
       }
    }
    
-   private void appendPolicyElements(StringBuilder builder, WSDLExtensibilityElement extElem)
-   {
-      if (Constants.WSDL_ELEMENT_POLICY.equalsIgnoreCase(extElem.getUri()) ||
-            Constants.WSDL_ELEMENT_POLICYREFERENCE.equalsIgnoreCase(extElem.getUri()))
-      {
-         appendElementSkippingKnownNs(builder, extElem.getElement());
-      }
-   }
-   
    private void appendJAXWSCustomizationElements(StringBuilder builder, WSDLExtensibilityElement extElem)
    {
       if (Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS.equalsIgnoreCase(extElem.getUri()))
@@ -388,18 +376,6 @@
             continue;
 
          buffer.append("<portType name='" + intf.getName().getLocalPart() + "'");
-         WSDLProperty policyProp = intf.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
-         if (policyProp != null)
-         {
-            String prefix = wsdl.getPrefix(Constants.URI_WS_POLICY);
-            buffer.append(" ");
-            buffer.append(prefix);
-            buffer.append(":");
-            buffer.append(Constants.WSDL_ATTRIBUTE_WSP_POLICYURIS.getLocalPart());
-            buffer.append("='");
-            buffer.append(policyProp.getValue());
-            buffer.append("'");
-         }
          buffer.append(">");
          appendDocumentation(buffer, intf.getDocumentationElement());
          appendUnknownExtensibilityElements(buffer, intf);

Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -21,8 +21,6 @@
  */
 package org.jboss.ws.tools.wsdl;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -32,21 +30,13 @@
 import javax.xml.rpc.ParameterMode;
 import javax.xml.ws.soap.SOAPBinding;
 
-import org.apache.ws.policy.Policy;
-import org.apache.ws.policy.util.PolicyFactory;
-import org.apache.ws.policy.util.PolicyWriter;
 import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
 import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.extensions.policy.PolicyScopeLevel;
-import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.MetaDataExtension;
 import org.jboss.ws.metadata.umdm.OperationMetaData;
 import org.jboss.ws.metadata.umdm.ParameterMetaData;
 import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.wsdl.Extendable;
 import org.jboss.ws.metadata.wsdl.WSDLBinding;
 import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
 import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -63,7 +53,6 @@
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
 import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
 import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
 import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
@@ -139,83 +128,7 @@
          processOperation(wsdlInterface, wsdlBinding, operation);
       }
       
-      //Policies
-      MetaDataExtension ext = endpoint.getExtension(Constants.URI_WS_POLICY);
-      if (ext != null)
-      {
-         PolicyMetaExtension policyExt = (PolicyMetaExtension)ext;
-         for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT))
-         {
-            addPolicyDefinition(policy);
-            addPolicyReference(policy, wsdlEndpoint);
-         }
-         for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT_TYPE))
-         {
-            addPolicyDefinition(policy);
-            addPolicyURIAttribute(policy, wsdlInterface);
-         }
-         for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_BINDING))
-         {
-            addPolicyDefinition(policy);
-            addPolicyReference(policy, wsdlBinding);
-         }
-      }
    }
-   
-   protected void addPolicyDefinition(Policy policy)
-   {
-      try
-      {
-         PolicyWriter writer = PolicyFactory.getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
-         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-         writer.writePolicy(policy, outputStream);
-         Element element = DOMUtils.parse(outputStream.toString(Constants.DEFAULT_XML_CHARSET));
-         WSDLExtensibilityElement ext = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY, element);
-         wsdl.addExtensibilityElement(ext);
-         //optional: to obtain a better looking wsdl, register ws-policy
-         //prefix in wsdl:definitions if it is not defined there yet
-         if (wsdl.getPrefix(element.getNamespaceURI())==null)
-         {
-            wsdl.registerNamespaceURI(element.getNamespaceURI(),element.getPrefix());
-         }
-      }
-      catch (IOException ioe)
-      {
-         throw new WSException("Error while converting policy to element!");
-      }
-   }
-   
-   protected void addPolicyReference(Policy policy, Extendable extendable)
-   {
-      QName policyRefQName = Constants.WSDL_ELEMENT_WSP_POLICYREFERENCE;
-      String prefix = wsdl.getPrefix(policyRefQName.getNamespaceURI());
-      if (prefix == null)
-      {
-         prefix = "wsp";
-         wsdl.registerNamespaceURI(policyRefQName.getNamespaceURI(), prefix);
-      }
-      Element element = DOMUtils.createElement(policyRefQName.getLocalPart(), prefix);
-      element.setAttribute("URI", policy.getPolicyURI());
-      //TODO!! we need to understand if the policy is local or not...
-      WSDLExtensibilityElement ext = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element);
-      extendable.addExtensibilityElement(ext);
-   }
-   
-   protected void addPolicyURIAttribute(Policy policy, Extendable extendable)
-   {
-      //TODO!! we need to understand if the policy is local or not...
-      WSDLProperty prop = extendable.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
-      if (prop == null)
-      {
-         extendable.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_POLICYURIS, policy.getPolicyURI()));
-      }
-      else
-      {
-         //PolicyURIs ships a comma separated list of URIs...
-         prop.setValue(prop.getValue() + "," + policy.getPolicyURI());
-      }
-      
-   }
 
    protected void processOperation(WSDLInterface wsdlInterface, WSDLBinding wsdlBinding, OperationMetaData operation)
    {

Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsconsume.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsconsume.xml	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsconsume.xml	2009-06-16 12:41:21 UTC (rev 10198)
@@ -25,8 +25,6 @@
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
-    <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecuritypolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
-    <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
     <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" destdir="${tests.output.dir}" nocompile="true" keep="true" verbose="false"/>
   </target>
   

Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsprovide.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsprovide.xml	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/antrun-wsprovide.xml	2009-06-16 12:41:21 UTC (rev 10198)
@@ -19,7 +19,6 @@
       <classpath>
         <pathelement path="${maven.test.classpath}"/>
       </classpath>
-      <classpath location="${tests.output.dir}/test-resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
     </taskdef>
 
     <wsprovide
@@ -29,13 +28,6 @@
       destdir="${tests.output.dir}/test-classes"
       verbose="false"/>
 
-    <wsprovide
-      resourcedestdir="${tests.output.dir}/test-resources/wsprovide/jaxws/samples/wssecurityAnnotatedpolicy"
-      genwsdl="true"
-      sei="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean"
-      destdir="${tests.output.dir}/test-classes"
-      verbose="false"/>
-
   </target>
 
 </project>

Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml	2009-06-16 12:41:21 UTC (rev 10198)
@@ -283,40 +283,6 @@
       </webinf>
     </war>
     
-    <!-- jaxws-samples-wssecurityAnnotatedpolicy-encrypt -->
-    <war warfile="${tests.output.dir}/test-libs/jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war"
-      webxml="${tests.output.dir}/test-resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml">
-      <classes dir="${tests.output.dir}/test-classes">
-        <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/Hello.class"/>
-        <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.class"/>
-        <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/UserType.class"/>
-      </classes>
-      <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wssecurityAnnotatedpolicy">
-        <include name="wsse.keystore"/>
-        <include name="wsse.truststore"/>
-      </webinf>
-      <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF">
-        <include name="Policy.xml"/>
-      </webinf>
-    </war>
-    
-    <!-- jaxws-samples-wssecuritypolicy-encrypt -->
-    <war warfile="${tests.output.dir}/test-libs/jaxws-samples-wssecuritypolicy-encrypt.war"
-      webxml="${tests.output.dir}/test-resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml">
-      <classes dir="${tests.output.dir}/test-classes">
-        <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/Hello.class"/>
-        <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.class"/>
-        <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/UserType.class"/>
-      </classes>
-      <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wssecuritypolicy">
-        <include name="wsse.keystore"/>
-        <include name="wsse.truststore"/>
-      </webinf>
-      <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wssecuritypolicy/WEB-INF">
-        <include name="wsdl/**"/>
-      </webinf>
-    </war>
-    
     <!-- Please add alphabetically -->
     
   </target>

Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -22,31 +22,20 @@
 package org.jboss.test.ws.common.wsdl11;
 
 import java.io.File;
-import java.io.Writer;
-import java.util.List;
 
 import javax.xml.namespace.QName;
 
-import org.jboss.test.ws.tools.validation.WSDLValidator;
 import org.jboss.ws.Constants;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
 import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
 import org.jboss.ws.metadata.wsdl.WSDLInterface;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
 import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLService;
 import org.jboss.ws.metadata.wsdl.WSDLTypes;
 import org.jboss.ws.metadata.wsdl.WSDLUtils;
 import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
 import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.common.IOUtils;
-import org.w3c.dom.Element;
 
 /**
  * Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
@@ -165,122 +154,4 @@
       assertNotNull(wsdlDefinitions); // should throw an Exception when SWA parts are not skipped
    }
    
-   /**************************************************
-    *  Test WSDL 1.1 marshal/unmarshal with policies *
-    **************************************************/
-   
-   public void testPolicyAttachment() throws Exception
-   {
-      File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachment.wsdl");
-      assertTrue(wsdlFile.exists());
-      testPolicyAttachment(wsdlFile);
-      wsdlFile = getResourceFile("common/wsdl11/PolicyAttachmentFragment.wsdl");
-      assertTrue(wsdlFile.exists());
-      testPolicyAttachment(wsdlFile);
-   }
-   
-   private void testPolicyAttachment(File wsdlFile) throws Exception
-   {
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
-      assertNotNull(wsdlDefinitions);
-      List<WSDLExtensibilityElement> list = wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY);
-      assertNotNull(list);
-      assertEquals(list.size(),5);
-      for (WSDLExtensibilityElement extEl : list)
-      {
-         Element el = extEl.getElement();
-         assertNotNull(el);
-         QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
-         assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","Policy","wsp"));
-         assertNotNull(el.getAttributeNodeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","Id"));
-         //System.out.println(DOMWriter.printNode(extEl.getElement(),true));
-      }
-   }
-   
-   public void testServicePolicyRef() throws Exception
-   {
-      File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachment.wsdl");
-      testServicePolicyRef(wsdlFile);
-      wsdlFile = getResourceFile("common/wsdl11/PolicyAttachmentFragment.wsdl");
-      testServicePolicyRef(wsdlFile);
-   }
-   
-   public void testServicePolicyRef(File wsdlFile) throws Exception
-   {
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
-      WSDLService wsdlService = wsdlDefinitions.getServices()[0];
-      List<WSDLExtensibilityElement> list = wsdlService.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(list);
-      assertEquals(list.size(),1);
-      assertPolicyRef(list.get(0),"uselessServicePolicy");
-   }
-   
-   public void testEndpointPolicyRef() throws Exception
-   {
-      File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachment.wsdl");
-      testEndpointPolicyRef(wsdlFile);
-      wsdlFile = getResourceFile("common/wsdl11/PolicyAttachmentFragment.wsdl");
-      testEndpointPolicyRef(wsdlFile);
-   }
-   
-   public void testEndpointPolicyRef(File wsdlFile) throws Exception
-   {
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
-      WSDLService wsdlService = wsdlDefinitions.getServices()[0];
-      WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
-      
-      List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extPortList);
-      assertEquals(extPortList.size(),1);
-      assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
-      
-      WSDLProperty extPortTypeProp = wsdlEndpoint.getInterface().getProperty(
-            Constants.WSDL_PROPERTY_POLICYURIS);
-      assertEquals(extPortTypeProp.getValue(),"#RmPolicy");
-      
-      WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
-      List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extBinding);
-      assertEquals(extBinding.size(),2);
-      assertPolicyRef(extBinding.get(0),"RmPolicy");
-      assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
-   }
-   
-   private void assertPolicyRef(WSDLExtensibilityElement extEl, String policyURI)
-   {
-      Element el = extEl.getElement();
-      QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
-      assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","PolicyReference","wsp"));
-      assertNotNull(el);
-      assertEquals(el.getAttributeNode("URI").getValue(),"#"+policyURI);
-   }
-   
-   public void testPolicyAttachmentReadWrite() throws Exception
-   {
-      //Read wsdl containing policies from file and get the wsdl metadata model 
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(getResourceURL("/common/wsdl11/PolicyAttachment.wsdl"));
-      assertNotNull(wsdlDefinitions);
-      //set wsdlOneOne to null to force wsdl generation from metadata model
-      wsdlDefinitions.setWsdlOneOneDefinition(null);
-      
-      //process the wsdl metadata model writing it back to another file
-      File wsdlDir = new File("./tools/wsdl-out");
-      if (!wsdlDir.exists()) wsdlDir.mkdirs();
-      Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlDir+"/GeneratedWsdlWithPolicies.wsdl"), Constants.DEFAULT_XML_CHARSET);
-      new WSDLWriter(wsdlDefinitions).write(fw, Constants.DEFAULT_XML_CHARSET);
-      fw.close();
-      
-      //parse the obtained file and validate the resulting wsdl metadata model against the first one
-      WSDLDefinitions newWsdlDefinitions = factory.parse(new File(wsdlDir+"/GeneratedWsdlWithPolicies.wsdl").toURL());
-      assertNotNull(newWsdlDefinitions);
-      WSDLValidator validator = new WSDLValidator();
-      assertTrue(validator.validate(wsdlDefinitions,newWsdlDefinitions));
-   }
 }

Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.common.wsdl11;
-
-import java.io.File;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
-import org.jboss.wsf.test.JBossWSTest;
-import org.w3c.dom.Element;
-
-/**
- * Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
- * using known and unknown wsdl extensibility elements.
- *
- * @author alessio.soldano at jboss.com
- * @since 15-Jan-2009
- */
-public class WSDLExtensElemTestCase extends JBossWSTest
-{
-   public void testPolicyEndpointExtensibilityElements() throws Exception
-   {
-      File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachment.wsdl");
-      assertTrue(wsdlFile.exists());
-      
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
-      WSDLService wsdlService = wsdlDefinitions.getServices()[0];
-      WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
-      
-      List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extPortList);
-      assertEquals(extPortList.size(),1);
-      assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
-      List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElements();
-      assertNotNull(portNotUnderstoodList);
-      assertEquals(0, portNotUnderstoodList.size());
-      
-      WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
-      List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extBinding);
-      assertEquals(extBinding.size(),2);
-      assertPolicyRef(extBinding.get(0),"RmPolicy");
-      assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
-      List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElements();
-      assertNotNull(bindingNotUnderstoodList);
-      assertEquals(0, bindingNotUnderstoodList.size());
-   }
-   
-   public void testPolicyAndUnkwnownEndpointExtensibilityElements() throws Exception
-   {
-      File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl");
-      assertTrue(wsdlFile.exists());
-      
-      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
-      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
-      WSDLService wsdlService = wsdlDefinitions.getServices()[0];
-      WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
-      
-      List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extPortList);
-      assertEquals(extPortList.size(),1);
-      assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
-      List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElements();
-      assertNotNull(portNotUnderstoodList);
-      assertEquals(1, portNotUnderstoodList.size());
-      assertUnknownExtElem(portNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", true);
-      
-      WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
-      List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
-            Constants.WSDL_ELEMENT_POLICYREFERENCE);
-      assertNotNull(extBinding);
-      assertEquals(extBinding.size(),2);
-      assertPolicyRef(extBinding.get(0),"RmPolicy");
-      assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
-      List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElements();
-      assertNotNull(bindingNotUnderstoodList);
-      assertEquals(2, bindingNotUnderstoodList.size());
-      assertUnknownExtElem(bindingNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", false);
-      assertUnknownExtElem(bindingNotUnderstoodList.get(1), "foo2", "http://foo.org/foo2", "bar", false);
-   }
-   
-   private static void assertPolicyRef(WSDLExtensibilityElement extEl, String policyURI)
-   {
-      Element el = extEl.getElement();
-      QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
-      assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","PolicyReference","wsp"));
-      assertEquals(el.getAttributeNode("URI").getValue(),"#"+policyURI);
-   }
-   
-   private static void assertUnknownExtElem(WSDLExtensibilityElement extEl, String prefix, String namespaceURI, String localName, boolean required)
-   {
-      Element el = extEl.getElement();
-      QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
-      assertEquals(qName, new QName(namespaceURI, localName, prefix));
-      assertEquals(required, "true".equals(el.getAttributeNS(Constants.NS_WSDL11, "required")));
-      assertEquals(required, extEl.isRequired());
-   }
-}

Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java	2009-06-16 12:41:21 UTC (rev 10198)
@@ -21,15 +21,12 @@
  */
 package org.jboss.test.ws.tools.validation;
 
-import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
 import org.jboss.ws.metadata.wsdl.Extendable;
 import org.jboss.ws.metadata.wsdl.WSDLBinding;
 import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -37,14 +34,12 @@
 import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
 import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
 import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
 import org.jboss.ws.metadata.wsdl.WSDLInterface;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInfault;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
 import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
 import org.jboss.ws.metadata.wsdl.WSDLService;
 import org.jboss.ws.tools.exceptions.JBossWSToolsException;
 import org.jboss.wsf.common.DOMUtils;
@@ -149,90 +144,10 @@
    {
       boolean bool = true;
       //add validation of further extensibility element types below
-      if (bool) bool = validatePolicyElements(ext1,ext2);
       
       return bool;
    }
    
-   
-   private static boolean validatePolicyElements(Extendable ext1, Extendable ext2)
-   throws JBossWSToolsException
-   {
-      //policies
-      List<WSDLExtensibilityElement> pol1 = new ArrayList<WSDLExtensibilityElement>(
-            ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
-      List<WSDLExtensibilityElement> pol2 = new ArrayList<WSDLExtensibilityElement>(
-            ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
-      //check whether lists are the same size
-      if (pol1.size() != pol2.size())
-         throw new JBossWSToolsException("Policy WSDLExtensibilityElement mismatch!");
-      //check equality
-      for (WSDLExtensibilityElement el1 : pol1)
-      {
-         boolean done = false;
-         Iterator it = pol2.iterator();
-         WSDLExtensibilityElement el2 = null;
-         while (it.hasNext() && !done)
-         {
-            el2 = (WSDLExtensibilityElement)it.next();
-            done = (el1.isRequired() == el2.isRequired()) &&
-               checkElementEquality(el1.getElement(), el2.getElement());
-         }
-         if (!done)
-         {
-            log.error("Failing policy validation on policy on: "+ext1+" and "+ext2);
-            return false;
-         }
-         pol2.remove(el2);
-      }
-      //policy references
-      List<WSDLExtensibilityElement> polRef1 = new ArrayList<WSDLExtensibilityElement>(
-            ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
-      List<WSDLExtensibilityElement> polRef2 = new ArrayList<WSDLExtensibilityElement>(
-            ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
-      //check whether lists are the same size
-      if (polRef1.size() != polRef2.size())
-         throw new JBossWSToolsException("Policy ref WSDLExtensibilityElement mismatch!");
-      //check equality
-      for (WSDLExtensibilityElement el1 : polRef1)
-      {
-         boolean done = false;
-         Iterator it = polRef2.iterator();
-         WSDLExtensibilityElement el2 = null;
-         while (it.hasNext() && !done)
-         {
-            el2 = (WSDLExtensibilityElement)it.next();
-            done = (el1.isRequired() == el2.isRequired()) &&
-               checkElementEquality(el1.getElement(), el2.getElement());
-         }
-         if (!done)
-         {
-            log.error("Failing policy validation on policy ref on: "+ext1+" and "+ext2);
-            return false;
-         }
-         polRef2.remove(el2);
-      }
-      //check properties
-      WSDLProperty prop1 = ext1.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
-      WSDLProperty prop2 = ext2.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
-      if (prop1 != null || prop2 != null)
-      {
-         if (prop1 == null || prop2 == null || prop1.isRequired() != prop2.isRequired())
-            throw new JBossWSToolsException("Policy prop WSDLExtensibilityElement mismatch!");
-         String value1 = prop1.getValue();
-         String value2 = prop2.getValue();
-         if (value1 != null || value2 != null)
-         {
-            if (value1 == null || value2 == null || !value1.equalsIgnoreCase(value2))
-            {
-               log.error("Failing policy validation on policy uri prop on: "+ext1+" and "+ext2);
-               return false;
-            }
-         }
-      }
-      return true;
-   }
-   
    /**
     * Validates the namespace definitions in the wsdl
     * @param w1 WSDL Definitions for the first wsdl

Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachment.wsdl
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachment.wsdl	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachment.wsdl	2009-06-16 12:41:21 UTC (rev 10198)
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
-	     xmlns:tns="http://org.jboss.ws/jaxrpc" 
-	     xmlns="http://schemas.xmlsoap.org/wsdl/" 
-	     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	     xmlns:ns2="http://org.jboss.ws/jaxrpc/types" 
-	     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
-	     xmlns:fab="http://www.fabrikam123.example.com/stock" 
-	     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" >
-  <wsp:Policy wsu:Id="RmPolicy" >
-    <rmp:RMAssertion>
-      <rmp:InactivityTimeout Milliseconds="600000" />
-      <rmp:BaseRetransmissionInterval Milliseconds="3000" />
-      <rmp:ExponentialBackoff />
-      <rmp:AcknowledgementInterval Milliseconds="200" />
-    </rmp:RMAssertion>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessServicePolicy" >
-    <fab:useless>nothing</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessPortPolicy" >
-    <fab:useless>nothing again</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="X509EndpointPolicy" >
-    <sp:AsymmetricBinding>
-      <wsp:Policy>
-        <!-- Details omitted for readability -->
-        <sp:IncludeTimestamp />
-        <sp:OnlySignEntireHeadersAndBody />
-      </wsp:Policy>
-    </sp:AsymmetricBinding>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="SecureMessagePolicy" >
-    <sp:SignedParts>
-      <sp:Body />
-    </sp:SignedParts>
-    <sp:EncryptedParts>
-      <sp:Body />
-    </sp:EncryptedParts>
-  </wsp:Policy>
-  <types>
-    <schema targetNamespace="http://org.jboss.ws/jaxrpc/types" xmlns:tns="http://org.jboss.ws/jaxrpc/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
-      <complexType name="echoSimpleUserType">
-        <sequence>
-          <element name="String_1" type="string" nillable="true"/>
-          <element name="SimpleUserType_2" type="tns:SimpleUserType" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="SimpleUserType">
-        <sequence>
-          <element name="a" type="int"/>
-          <element name="b" type="int"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoSimpleUserTypeResponse">
-        <sequence>
-          <element name="result" type="tns:SimpleUserType" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoString">
-        <sequence>
-          <element name="String_1" type="string" nillable="true"/>
-          <element name="String_2" type="string" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoStringResponse">
-        <sequence>
-          <element name="result" type="string" nillable="true"/>
-        </sequence>
-      </complexType>
-      <element name="echoSimpleUserType" type="tns:echoSimpleUserType"/>
-      <element name="echoSimpleUserTypeResponse" type="tns:echoSimpleUserTypeResponse"/>
-      <element name="echoString" type="tns:echoString"/>
-      <element name="echoStringResponse" type="tns:echoStringResponse"/>
-    </schema>
-  </types>
-  <message name="JaxRpcTestService_echoSimpleUserType">
-    <part name="parameters" element="ns2:echoSimpleUserType"/>
-  </message>
-  <message name="JaxRpcTestService_echoSimpleUserTypeResponse">
-    <part name="result" element="ns2:echoSimpleUserTypeResponse"/>
-  </message>
-  <message name="JaxRpcTestService_echoString">
-    <part name="parameters" element="ns2:echoString"/>
-  </message>
-  <message name="JaxRpcTestService_echoStringResponse">
-    <part name="result" element="ns2:echoStringResponse"/>
-  </message>
-  <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
-    <operation name="echoSimpleUserType">
-      <input message="tns:JaxRpcTestService_echoSimpleUserType"/>
-      <output message="tns:JaxRpcTestService_echoSimpleUserTypeResponse"/>
-    </operation>
-    <operation name="echoString">
-      <input message="tns:JaxRpcTestService_echoString"/>
-      <output message="tns:JaxRpcTestService_echoStringResponse"/>
-    </operation>
-  </portType>
-  <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
-    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
-    <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
-    <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
-    <operation name="echoSimpleUserType">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal"/>
-      </input>
-      <output>
-        <soap:body use="literal"/>
-      </output>
-    </operation>
-    <operation name="echoString">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal"/>
-      </input>
-      <output>
-        <soap:body use="literal"/>
-      </output>
-    </operation>
-  </binding>
-  <service name="TestService">
-    <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
-    <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
-      <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
-      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
-    </port>
-  </service>
-</definitions>

Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl	2009-06-16 12:41:21 UTC (rev 10198)
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
-	     xmlns:tns="http://org.jboss.ws/jaxrpc" 
-	     xmlns="http://schemas.xmlsoap.org/wsdl/" 
-	     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	     xmlns:ns2="http://org.jboss.ws/jaxrpc/types" 
-	     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
-	     xmlns:fab="http://www.fabrikam123.example.com/stock" 
-	     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:foo1="http://foo.org/foo1"  
-	     xmlns:foo2="http://foo.org/foo2"  
-	     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
-  <wsp:Policy wsu:Id="RmPolicy" >
-    <rmp:RMAssertion>
-      <rmp:InactivityTimeout Milliseconds="600000" />
-      <rmp:BaseRetransmissionInterval Milliseconds="3000" />
-      <rmp:ExponentialBackoff />
-      <rmp:AcknowledgementInterval Milliseconds="200" />
-    </rmp:RMAssertion>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessServicePolicy" >
-    <fab:useless>nothing</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessPortPolicy" >
-    <fab:useless>nothing again</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="X509EndpointPolicy" >
-    <sp:AsymmetricBinding>
-      <wsp:Policy>
-        <!-- Details omitted for readability -->
-        <sp:IncludeTimestamp />
-        <sp:OnlySignEntireHeadersAndBody />
-      </wsp:Policy>
-    </sp:AsymmetricBinding>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="SecureMessagePolicy" >
-    <sp:SignedParts>
-      <sp:Body />
-    </sp:SignedParts>
-    <sp:EncryptedParts>
-      <sp:Body />
-    </sp:EncryptedParts>
-  </wsp:Policy>
-  <types>
-    <schema targetNamespace="http://org.jboss.ws/jaxrpc/types" xmlns:tns="http://org.jboss.ws/jaxrpc/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
-      <complexType name="echoSimpleUserType">
-        <sequence>
-          <element name="String_1" type="string" nillable="true"/>
-          <element name="SimpleUserType_2" type="tns:SimpleUserType" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="SimpleUserType">
-        <sequence>
-          <element name="a" type="int"/>
-          <element name="b" type="int"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoSimpleUserTypeResponse">
-        <sequence>
-          <element name="result" type="tns:SimpleUserType" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoString">
-        <sequence>
-          <element name="String_1" type="string" nillable="true"/>
-          <element name="String_2" type="string" nillable="true"/>
-        </sequence>
-      </complexType>
-      <complexType name="echoStringResponse">
-        <sequence>
-          <element name="result" type="string" nillable="true"/>
-        </sequence>
-      </complexType>
-      <element name="echoSimpleUserType" type="tns:echoSimpleUserType"/>
-      <element name="echoSimpleUserTypeResponse" type="tns:echoSimpleUserTypeResponse"/>
-      <element name="echoString" type="tns:echoString"/>
-      <element name="echoStringResponse" type="tns:echoStringResponse"/>
-    </schema>
-  </types>
-  <message name="JaxRpcTestService_echoSimpleUserType">
-    <part name="parameters" element="ns2:echoSimpleUserType"/>
-  </message>
-  <message name="JaxRpcTestService_echoSimpleUserTypeResponse">
-    <part name="result" element="ns2:echoSimpleUserTypeResponse"/>
-  </message>
-  <message name="JaxRpcTestService_echoString">
-    <part name="parameters" element="ns2:echoString"/>
-  </message>
-  <message name="JaxRpcTestService_echoStringResponse">
-    <part name="result" element="ns2:echoStringResponse"/>
-  </message>
-  <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
-    <operation name="echoSimpleUserType">
-      <input message="tns:JaxRpcTestService_echoSimpleUserType"/>
-      <output message="tns:JaxRpcTestService_echoSimpleUserTypeResponse"/>
-    </operation>
-    <operation name="echoString">
-      <input message="tns:JaxRpcTestService_echoString"/>
-      <output message="tns:JaxRpcTestService_echoStringResponse"/>
-    </operation>
-  </portType>
-  <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
-    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
-    <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
-    <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
-	<foo1:bar wsdl:required="false"/>
-    <foo2:bar/>
-    <operation name="echoSimpleUserType">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal"/>
-      </input>
-      <output>
-        <soap:body use="literal"/>
-      </output>
-    </operation>
-    <operation name="echoString">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal"/>
-      </input>
-      <output>
-        <soap:body use="literal"/>
-      </output>
-    </operation>
-  </binding>
-  <service name="TestService">
-    <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
-    <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
-      <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
-      <foo1:bar wsdl:required="true"/>
-      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
-    </port>
-  </service>
-</definitions>

Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl	2009-06-16 12:39:23 UTC (rev 10197)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl	2009-06-16 12:41:21 UTC (rev 10198)
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
-	     xmlns:tns="http://org.jboss.ws/jaxrpc" 
-	     xmlns="http://schemas.xmlsoap.org/wsdl/" 
-	     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
-	     xmlns:fab="http://www.fabrikam123.example.com/stock" 
-	     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" >
-  <wsp:Policy wsu:Id="RmPolicy" >
-    <rmp:RMAssertion>
-      <rmp:InactivityTimeout Milliseconds="600000" />
-      <rmp:BaseRetransmissionInterval Milliseconds="3000" />
-      <rmp:ExponentialBackoff />
-      <rmp:AcknowledgementInterval Milliseconds="200" />
-    </rmp:RMAssertion>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessServicePolicy" >
-    <fab:useless>nothing</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="uselessPortPolicy" >
-    <fab:useless>nothing again</fab:useless>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="X509EndpointPolicy" >
-    <sp:AsymmetricBinding>
-      <wsp:Policy>
-        <!-- Details omitted for readability -->
-        <sp:IncludeTimestamp />
-        <sp:OnlySignEntireHeadersAndBody />
-      </wsp:Policy>
-    </sp:AsymmetricBinding>
-  </wsp:Policy>
-  <wsp:Policy wsu:Id="SecureMessagePolicy" >
-    <sp:SignedParts>
-      <sp:Body />
-    </sp:SignedParts>
-    <sp:EncryptedParts>
-      <sp:Body />
-    </sp:EncryptedParts>
-  </wsp:Policy>
-  <types>
-  </types>
-  <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
-  </portType>
-  <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
-    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
-    <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
-    <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
-  </binding>
-  <service name="TestService">
-    <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
-    <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
-      <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
-      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
-    </port>
-  </service>
-</definitions>




More information about the jbossws-commits mailing list