Package org.eclipse.wst.wsdl.validation.internal

Examples of org.eclipse.wst.wsdl.validation.internal.ValidationInfoImpl


            org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator validator =
                    new org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator();
            ResourceBundle rb = ResourceBundle.getBundle("validatewsdl");
            MessageGenerator messagegenerator = new MessageGenerator(rb);

            ControllerValidationInfo info = new ValidationInfoImpl(uri, messagegenerator);
            URIResolver uriResolver = new URIResolver();
            ((ValidationInfoImpl) info).setURIResolver(uriResolver);
            StandardParserConfiguration configuration = new StandardParserConfiguration();
            DOMParser builder = new LineNumberDOMParser(configuration);
            builder.parse(uri);

            DocumentBuilder db;
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);

            try {
                db = dbf.newDocumentBuilder();
            } catch (Exception e) {
                dbf = DocumentBuilderFactory.newInstance();
                db = dbf.newDocumentBuilder();
            }
            log.trace("Finished initializing WSI Validator");
            Document doc = db.parse(uri);
            log.trace("Finished parsing document");
            log.trace("Invoking WSI Validate method on WSDL");
            validator.validate(doc, info);
            log.trace("Finished invoking WSI Validate method on WSDL");
            if (!validator.isValid()) {
                validationFailed = true;
            }
            IValidationMessage messages[] = info.getValidationMessages();
            if (messages != null && messages.length > 0) {
                log.trace("Finished retrieving " + messages.length + " validation messages");
                for (int i = 0; i < messages.length; i++) {
                    IValidationMessage message = messages[i];
                    errorMesage.add(message.getMessage());
View Full Code Here


                dbf = DocumentBuilderFactory.newInstance();
                db = dbf.newDocumentBuilder();
            }

            Document doc = db.parse(inputStream);
            ControllerValidationInfo validateInfo = new ValidationInfoImpl(sourceURL, messagegenerator);

            URIResolver uriResolver = new URIResolver();
            ((ValidationInfoImpl) validateInfo).setURIResolver(uriResolver);
            /*java.util.Hashtable attributes = new java.util.Hashtable();
            ((ValidationInfoImpl) validateInfo).setAttributes(attributes);*/

            WSDL11ValidationInfoImpl info = new WSDL11ValidationInfoImpl(validateInfo);
            info.setElementLocations(new java.util.Hashtable());
            WSDL11BasicValidator validator = new WSDL11BasicValidator();
            registerExtensionValidators(validator.getClass().getClassLoader());
            IValidationMessage[] messages;

            ExtendedWSDL11ValidatorController wsdl11ValidatorController =
                    new ExtendedWSDL11ValidatorController();
            WSDLDocument[] wsdlDocs = wsdl11ValidatorController.readWSDLDocument(doc,
                    validateInfo.getFileURI(),
                    messagegenerator,
                    info);
            WSDLDocument document = wsdlDocs[0];
            List schema = document.getSchemas();
            Iterator xsdIter = schema.iterator();
            while (xsdIter.hasNext()) {
                info.addSchema((XSModel) xsdIter.next());
            }
            // Set the element locations table.
            info.setElementLocations(document.getElementLocations());
            validator.validate(wsdlDefinition, new ArrayList(), info);
            messages = validateInfo.getValidationMessages();

            WSDLValidationInfo wsdlValidationInfo = new WSDLValidationInfo();
            if (messages.length > 0) {
                wsdlValidationInfo.setStatus(INVALID);
            } else {
                wsdlValidationInfo.setStatus(VALID);
            }
            for (IValidationMessage message : messages) {
                String messageString =
                        "[" + message.getLine() + "][" + message.getColumn() + "]"
                                + message.getMessage();
                wsdlValidationInfo.addValidationMessage(messageString);
            }
            if (WSITestToolsPlugin.getPlugin() == null) {
                WSITestToolsPlugin.getInstance();
                WSITestToolsProperties.setEclipseContext(false);
                BaseValidator[] validators = new BaseValidator[4];

                ProfileValidatorFactoryImpl factory = new ProfileValidatorFactoryImpl();
                validators[0] = factory.newWSDLValidator();
                validators[1] = factory.newUDDIValidator();
                validators[2] = factory.newEnvelopeValidator();
                validators[3] = factory.newMessageValidator();
                WSITestToolsPlugin.getPlugin().setBaseValidators(validators);
            }
            org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator wsiValidator =
                    new org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator();

            ControllerValidationInfo validationInfo = new ValidationInfoImpl(sourceURL, messagegenerator);
            ((ValidationInfoImpl) validationInfo).setURIResolver(uriResolver);

            WSDLValidationInfo wsiValidationInfo = new WSDLValidationInfo();

            wsiValidator.validate(doc, validationInfo);
            messages = validationInfo.getValidationMessages();
            if (messages.length > 0) {
                wsiValidationInfo.setStatus(INVALID);
            } else {
                wsiValidationInfo.setStatus(VALID);
            }
View Full Code Here

            Document doc = db.parse(inputStream);
            WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
            reader.setFeature("javax.wsdl.importDocuments", true);
            reader.setFeature("javax.wsdl.verbose", log.isDebugEnabled());
            Definition wsdlDefinition = reader.readWSDL(uri);
            ControllerValidationInfo validateInfo = new ValidationInfoImpl(uri, messagegenerator);

            URIResolver uriResolver = new URIResolver();
            ((ValidationInfoImpl) validateInfo).setURIResolver(uriResolver);
            /*java.util.Hashtable attributes = new java.util.Hashtable();
            ((ValidationInfoImpl) validateInfo).setAttributes(attributes);*/

            WSDL11ValidationInfoImpl info = new WSDL11ValidationInfoImpl(validateInfo);
            info.setElementLocations(new java.util.Hashtable());
            WSDL11BasicValidator validator = new WSDL11BasicValidator();
            registerExtensionValidators(validator.getClass().getClassLoader());
            /*validator.setResourceBundle(rb);*/
            IValidationMessage[] messages;

            ExtendedWSDL11ValidatorController wsdl11ValidatorController =
                    new ExtendedWSDL11ValidatorController();
            WSDLDocument[] wsdlDocs = wsdl11ValidatorController.readWSDLDocument(doc,
                    validateInfo.getFileURI(),
                    messagegenerator,
                    info);
            WSDLDocument document = wsdlDocs[0];
            List schema = document.getSchemas();
            Iterator xsdIter = schema.iterator();
            while (xsdIter.hasNext()) {
                info.addSchema((XSModel) xsdIter.next());
            }
            // Set the element locations table.
            info.setElementLocations(document.getElementLocations());
            validator.validate(wsdlDefinition, new ArrayList(), info);
            messages = validateInfo.getValidationMessages();

            WSDLValidationInfo wsdlValidationInfo = new WSDLValidationInfo();
            if (messages.length > 0) {
                wsdlValidationInfo.setStatus(INVALID);
            } else {
View Full Code Here

    Definition definition = null;
  boolean hasAnalyzerConfig = false;
    try
    {
      //WSDLFactory factory = WSDLFactory.newInstance();
     ValidationInfoImpl vali = new ValidationInfoImpl(valInfo.getFileURI(), new MessageGenerator(resourcebundle));
      vali.setURIResolver((URIResolver)valInfo.getURIResolver());
      WSDLReaderImpl reader = new WSDLReaderImpl(new WSDL11ValidationInfoImpl(vali));
      WSDLDocument[] docs = reader.readWSDL(uri, domModel);
      int numdocs = docs.length;
      for(int i = 0; i < numdocs; i++)
      {
View Full Code Here

           Document doc = db.parse(inputStream);
           WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
           reader.setFeature("javax.wsdl.importDocuments", true);
           Definition wsdlDefinition = reader.readWSDL(url.toString());
           ControllerValidationInfo validateInfo = new ValidationInfoImpl(url.toString(),
                   messagegenerator);

           URIResolver uriResolver = new URIResolver();
           ((ValidationInfoImpl) validateInfo).setURIResolver(uriResolver);
           /*java.util.Hashtable attributes = new java.util.Hashtable();
            ((ValidationInfoImpl) validateInfo).setAttributes(attributes);*/

           WSDL11ValidationInfoImpl info = new WSDL11ValidationInfoImpl(validateInfo);
           info.setElementLocations(new java.util.Hashtable());
           WSDL11BasicValidator validator = new WSDL11BasicValidator();
//           registerExtensionValidators(validator.getClass().getClassLoader());
           /*validator.setResourceBundle(rb);*/
           IValidationMessage[] messages;

           ExtendedWSDL11ValidatorController wsdl11ValidatorController =
                   new ExtendedWSDL11ValidatorController();
           WSDLDocument[] wsdlDocs = wsdl11ValidatorController.readWSDLDocument(doc,
                   validateInfo.getFileURI(),
                   messagegenerator,
                   info);
           WSDLDocument document = wsdlDocs[0];
           List schema = document.getSchemas();
           for (Object aSchema : schema) {
               info.addSchema((XSModel) aSchema);
           }
           // Set the element locations table.
           info.setElementLocations(document.getElementLocations());
           validator.validate(wsdlDefinition, new ArrayList(), info);
           messages = validateInfo.getValidationMessages();

           WSDLValidationInfo wsdlValidationInfo = new WSDLValidationInfo();
           if (messages.length > 0) {
               wsdlValidationInfo.setStatus(WSDL_INVALID);
           } else {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsdl.validation.internal.ValidationInfoImpl

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.