Package org.jboss.ws.feature

Examples of org.jboss.ws.feature.SchemaValidationFeature


   {
      URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");
      URL xsdURL = new SchemaExtractor().getSchemaUrl(wsdlURL);
     
      Service service = Service.create(wsdlURL, SERVICE_NAME);
      SchemaValidationFeature feature = new SchemaValidationFeature(xsdURL.toString());
      MyTest port = service.getPort(MyTest.class, feature);
      try
      {
         port.performTest(new Long(2000));
      }
View Full Code Here


   {
      URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");
      URL xsdURL = new SchemaExtractor().getSchemaUrl(wsdlURL);
     
      Service service = Service.create(wsdlURL, SERVICE_NAME);
      SchemaValidationFeature feature = new SchemaValidationFeature(xsdURL.toString());
     
      TestErrorHandler errorHandler = new TestErrorHandler();
      feature.setErrorHandler(errorHandler);
     
      MyTest port = service.getPort(MyTest.class, feature);
      port.performTest(new Long(2000));
     
      String msg = errorHandler.getErrors();
View Full Code Here

   }

   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).getMetaDataFileURL(xsdLoc);
               xsdLoc = xsdURL.toExternalForm();
            }
            catch (IOException ex)
            {
               throw new WSException("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("Cannot instanciate error handler: " + handlerClass, ex);
         }
View Full Code Here

   }

   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).getMetaDataFileURL(xsdLoc);
               xsdLoc = xsdURL.toExternalForm();
            }
            catch (IOException ex)
            {
               throw new WSException("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("Cannot instanciate error handler: " + handlerClass, ex);
         }
View Full Code Here

  
   public void testValidatingClientWithExplicitSchema() throws Exception
   {
      URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");    
      Service service = Service.create(wsdlURL, SERVICE_NAME);
      SchemaValidationFeature feature = new SchemaValidationFeature();
      MyTest port = service.getPort(MyTest.class, feature);
      ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:9090/jaxws-jbws1172/doval");
      try
      {
         port.performTest(new Integer(2000));
View Full Code Here

  
   public void testValidatingClientWithErrorHandler() throws Exception
   {
      URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");    
      Service service = Service.create(wsdlURL, SERVICE_NAME);
      SchemaValidationFeature feature = new SchemaValidationFeature();
     
      TestErrorHandler errorHandler = new TestErrorHandler();
      feature.setErrorHandler(errorHandler);
     
      MyTest port = service.getPort(MyTest.class, feature);
      try
      {
         port.performTest(new Integer(2000));
View Full Code Here

   }

   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).getMetaDataFileURL(xsdLoc);
               xsdLoc = xsdURL.toExternalForm();
            }
            catch (IOException ex)
            {
               throw new WSException("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("Cannot instanciate error handler: " + handlerClass, ex);
         }
View Full Code Here

TOP

Related Classes of org.jboss.ws.feature.SchemaValidationFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.