[jbossws-commits] JBossWS SVN: r15997 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/jaxws/client and 7 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Mar 19 06:42:37 EDT 2012


Author: ropalka
Date: 2012-03-19 06:42:34 -0400 (Mon, 19 Mar 2012)
New Revision: 15997

Removed:
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/validation/
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/feature/SchemaValidationFeature.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1172/
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1172/
Modified:
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
   stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-3466] removing SchemaValidation feature

Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/annotation/SchemaValidation.java	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/annotation/SchemaValidation.java	2012-03-19 10:42:34 UTC (rev 15997)
@@ -1,65 +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.ws.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.xml.ws.spi.WebServiceFeatureAnnotation;
-
-import org.jboss.ws.extensions.validation.StrictlyValidErrorHandler;
-import org.jboss.ws.feature.SchemaValidationFeature;
-
-/**
- * This feature represents the use of schema validation with a 
- * web service.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 29-Feb-2008
- */
- at Retention(value = RetentionPolicy.RUNTIME)
- at Target(value = { ElementType.TYPE })
- at EndpointFeature( id = SchemaValidationFeature.ID)
- at WebServiceFeatureAnnotation(id = SchemaValidationFeature.ID, bean = SchemaValidationFeature.class)
-public @interface SchemaValidation 
-{
-   /**
-    * Optional property for the schema location. If this is not specified the schema
-    * will be attempted to extract from the WSDL.
-    * 
-    * The syntax is the same as for schemaLocation attributes in instance documents: e.g, "http://www.example.com file_name.xsd".
-    */
-   String schemaLocation() default "";
-   
-   /**
-    * Optional property for the error handler. 
-    * If this is not specified the @{ValidationErrorHandler} will be used.
-    */
-   Class errorHandler() default StrictlyValidErrorHandler.class;
-   
-   /**
-    * Specifies if the feature is enabled or disabled
-    */
-   boolean enabled() default true;
-}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java	2012-03-19 10:42:34 UTC (rev 15997)
@@ -41,7 +41,6 @@
 import org.jboss.ws.core.jaxws.binding.BindingExt;
 import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
 import org.jboss.ws.feature.ChunkedEncodingFeature;
-import org.jboss.ws.feature.SchemaValidationFeature;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.FeatureAwareEndpointMetaData;
 import org.jboss.ws.metadata.umdm.FeatureSet;
@@ -69,7 +68,6 @@
    private static FeatureSet supportedFeatures = new FeatureSet();
    static
    {
-      supportedFeatures.addFeature(new SchemaValidationFeature());
       supportedFeatures.addFeature(new AddressingFeature());
       supportedFeatures.addFeature(new MTOMFeature());
       supportedFeatures.addFeature(new RespectBindingFeature());

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java	2012-03-19 10:42:34 UTC (rev 15997)
@@ -21,27 +21,11 @@
  */
 package org.jboss.ws.core.soap;
 
-import java.io.InputStream;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-import java.net.URL;
-
 import javax.xml.namespace.QName;
 import javax.xml.soap.Name;
 import javax.xml.soap.SOAPBodyElement;
-import javax.xml.transform.Source;
 
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
 import org.jboss.ws.core.soap.SOAPContent.State;
-import org.jboss.ws.extensions.validation.SchemaExtractor;
-import org.jboss.ws.extensions.validation.SchemaValidationHelper;
-import org.jboss.ws.feature.SchemaValidationFeature;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.common.DOMUtils;
-import org.w3c.dom.Element;
-import org.xml.sax.ErrorHandler;
 
 /**
  * An abstract implemenation of the SOAPBodyElement
@@ -54,12 +38,6 @@
  */
 public class SOAPBodyElementDoc extends SOAPContentElement implements SOAPBodyElement
 {
-   private static final ResourceBundle bundle = BundleUtils.getBundle(EndpointMetaData.class);
-   // provide logging
-   private static Logger log = Logger.getLogger(SOAPBodyElementDoc.class);
-   
-   private SchemaValidationFeature feature;
-   
    public SOAPBodyElementDoc(Name name)
    {
       super(name);
@@ -81,74 +59,8 @@
       State prevState = soapContent.getState();
       if (nextState != prevState)
       {
-         if (isValidationEnabled() && nextState == State.OBJECT_VALID)
-         {
-            log.info("Validating: " + prevState);
-            validatePayload(soapContent.getPayload());
-         }
-         
          prevState = super.transitionTo(nextState);
-         
-         if (isValidationEnabled() && prevState == State.OBJECT_VALID)
-         {
-            log.info("Validating: " + nextState);
-            validatePayload(soapContent.getPayload());
-         }
       }
       return prevState;
    }
-
-   private void validatePayload(Source source) 
-   {
-      SchemaExtractor schemaExtractor = new SchemaExtractor();
-      try
-      {
-         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-         EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
-         feature = epMetaData.getFeature(SchemaValidationFeature.class);
-         URL xsdURL = feature.getSchemaLocation() != null ? new URL(feature.getSchemaLocation()) : null;
-         InputStream[] xsdStreams = null;
-         if (xsdURL == null)
-         {
-            URL wsdlURL = epMetaData.getServiceMetaData().getWsdlFileOrLocation();
-            if (wsdlURL == null)
-            {
-               log.warn(BundleUtils.getMessage(bundle, "VALIDATION_ERROR"));
-            }
-            else
-            {
-               xsdStreams = schemaExtractor.getSchemas(wsdlURL);
-            }
-         }
-         if (xsdURL != null)
-         {
-            ErrorHandler errorHandler = feature.getErrorHandler();
-            Element xmlDOM = DOMUtils.sourceToElement(source);
-            new SchemaValidationHelper(xsdURL).setErrorHandler(errorHandler).validateDocument(xmlDOM);
-         }
-         else //xsdStreams != null
-         {
-            ErrorHandler errorHandler = feature.getErrorHandler();
-            Element xmlDOM = DOMUtils.sourceToElement(source);
-            new SchemaValidationHelper(xsdStreams).setErrorHandler(errorHandler).validateDocument(xmlDOM);
-         }
-      }
-      catch (RuntimeException rte)
-      {
-         throw rte;
-      }
-      catch (Exception ex)
-      {
-         WSException.rethrow(ex);
-      }
-   }
-
-   private boolean isValidationEnabled()
-   {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      if (msgContext != null)
-         feature = msgContext.getEndpointMetaData().getFeature(SchemaValidationFeature.class);
-      
-      return feature != null ? feature.isEnabled() : false;
-   }
 }

Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/feature/SchemaValidationFeature.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/feature/SchemaValidationFeature.java	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/feature/SchemaValidationFeature.java	2012-03-19 10:42:34 UTC (rev 15997)
@@ -1,127 +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.ws.feature;
-
-import javax.xml.ws.WebServiceFeature;
-
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.extensions.validation.StrictlyValidErrorHandler;
-import org.xml.sax.ErrorHandler;
-
-/**
- * This feature represents the use of schema validation with a 
- * web service.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 29-Feb-2008
- */
-public final class SchemaValidationFeature extends WebServiceFeature
-{
-   /** 
-    * Constant value identifying the SchemaValidationFeature
-    */
-   public static final String ID = Constants.NS_JBOSSWS_URI + "/features/schema-validation";
-
-   /**
-    * Optional property for the schema location. If this is not specified the schema
-    * will be attempted to extract from the WSDL.
-    * 
-    * The syntax is the same as for schemaLocation attributes in instance documents: e.g, "http://www.example.com file_name.xsd".
-    */
-   protected String schemaLocation;
-   
-   /**
-    * Optional property for the error handler. 
-    * If this is not specified the @{ValidationErrorHandler} will be used.
-    */
-   protected ErrorHandler errorHandler = new StrictlyValidErrorHandler(); 
-
-   /**
-    * Create an <code>SchemaValidationFeature</code>.
-    * The instance created will be enabled.
-    */
-   public SchemaValidationFeature()
-   {
-      this.enabled = true;
-   }
-
-   /**
-    * Creates an <code>SchemaValidationFeature</code>.
-    * 
-    * @param enabled specifies if this feature should be enabled or not
-    */
-   public SchemaValidationFeature(boolean enabled)
-   {
-      this.enabled = enabled;
-   }
-
-   /**
-    * Creates an <code>SchemaValidationFeature</code>.
-    * 
-    * @param schemaLocation specifies the schema location for this feature
-    */
-   public SchemaValidationFeature(String schemaLocation)
-   {
-      this.schemaLocation = schemaLocation;
-      this.enabled = true;
-   }
-
-   /**
-    * Creates an <code>SchemaValidationFeature</code>.
-    * 
-    * @param enabled specifies if this feature should be enabled or not
-    * @param schemaLocation specifies the schema location for this feature
-    */
-   public SchemaValidationFeature(boolean enabled, String schemaLocation)
-   {
-      this.schemaLocation = schemaLocation;
-      this.enabled = enabled;
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getID()
-   {
-      return ID;
-   }
-
-   public String getSchemaLocation()
-   {
-      return schemaLocation;
-   }
-
-   public void setSchemaLocation(String schemaLocation)
-   {
-      this.schemaLocation = schemaLocation;
-   }
-
-   public ErrorHandler getErrorHandler()
-   {
-      return errorHandler;
-   }
-
-   public void setErrorHandler(ErrorHandler errorHandler)
-   {
-      this.errorHandler = errorHandler;
-   }
-}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java	2012-03-19 10:42:34 UTC (rev 15997)
@@ -21,9 +21,7 @@
  */
 package org.jboss.ws.metadata.builder.jaxws;
 
-import java.io.IOException;
 import java.lang.annotation.Annotation;
-import java.net.URL;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -38,12 +36,9 @@
 import javax.xml.ws.spi.WebServiceFeatureAnnotation;
 
 import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.annotation.SchemaValidation;
 import org.jboss.ws.api.util.BundleUtils;
 import org.jboss.ws.common.DOMWriter;
 import org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler;
-import org.jboss.ws.feature.SchemaValidationFeature;
 import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
 import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
 import org.jboss.ws.metadata.umdm.ServiceMetaData;
@@ -53,10 +48,8 @@
 import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
 import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
 import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-import org.xml.sax.ErrorHandler;
 
 /**
  * Process EndpointFeature annotations
@@ -88,10 +81,6 @@
                MTOMFeature feature = new MTOMFeature(anFeature.enabled(), anFeature.threshold());
                sepMetaData.addFeature(feature);
             }
-            else if (an.annotationType() == SchemaValidation.class)
-            {
-               processSchemaValidation(dep, sepMetaData, sepClass);
-            }
             else if (an.annotationType() == RespectBinding.class)
             {
                RespectBinding anFeature = sepClass.getAnnotation(RespectBinding.class);
@@ -195,42 +184,4 @@
       }
    }
 
-   private void processSchemaValidation(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
-   {
-      SchemaValidation anFeature = sepClass.getAnnotation(SchemaValidation.class);
-      SchemaValidationFeature feature = new SchemaValidationFeature(anFeature.enabled());
-
-      String xsdLoc = anFeature.schemaLocation();
-      if (xsdLoc.length() > 0)
-      {
-         if (dep instanceof ArchiveDeployment)
-         {
-            try
-            {
-               URL xsdURL = ((ArchiveDeployment)dep).getResourceResolver().resolve(xsdLoc);
-               xsdLoc = xsdURL.toExternalForm();
-            }
-            catch (IOException ex)
-            {
-               throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_SCHEMA",  xsdLoc),  ex);
-            }
-         }
-         feature.setSchemaLocation(xsdLoc);
-      }
-
-      Class<?> handlerClass = anFeature.errorHandler();
-      if (handlerClass != null)
-      {
-         try
-         {
-            ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
-            feature.setErrorHandler(errorHandler);
-         }
-         catch (Exception ex)
-         {
-            throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_INSTANCIATE_ERROR_HANDLER",  handlerClass),  ex);
-         }
-      }
-      sepMetaData.addFeature(feature);
-   }
 }

Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml	2012-03-19 09:52:46 UTC (rev 15996)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml	2012-03-19 10:42:34 UTC (rev 15997)
@@ -160,18 +160,6 @@
 			</metainf>
 		</jar>
 
-		<!-- jaxws-jbws1172 -->
-		<war destfile="${tests.output.dir}/test-libs/jaxws-jbws1172.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws1172/WEB-INF/web.xml">
-			<classes dir="${tests.output.dir}/test-classes">
-				<include name="org/jboss/test/ws/jaxws/jbws1172/NonValidatingEndpoint.class" />
-				<include name="org/jboss/test/ws/jaxws/jbws1172/ValidatingEndpoint.class" />
-				<include name="org/jboss/test/ws/jaxws/jbws1172/types/*.class" />
-			</classes>
-			<webinf dir="${tests.output.dir}/test-resources/jaxws/jbws1172/WEB-INF">
-				<include name="wsdl/**" />
-			</webinf>
-		</war>
-
 		<!-- jaxws-jbws1309-->
 		<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws1309.jar">
 			<fileset dir="${tests.output.dir}/test-classes">



More information about the jbossws-commits mailing list