Search in sources :

Example 1 with WSDL11Validator

use of org.apache.cxf.tools.validator.internal.WSDL11Validator in project cxf by apache.

the class AbstractWSDLToProcessor method validateWSDL.

public void validateWSDL() throws ToolException {
    if (env.fullValidateWSDL()) {
        WSDL11Validator validator = new WSDL11Validator(this.wsdlDefinition, this.env);
        validator.isValid();
    }
}
Also used : WSDL11Validator(org.apache.cxf.tools.validator.internal.WSDL11Validator)

Example 2 with WSDL11Validator

use of org.apache.cxf.tools.validator.internal.WSDL11Validator in project cxf by apache.

the class WSDLValidator method executeForMaven.

public boolean executeForMaven() {
    super.execute(false);
    ToolContext env = getContext();
    env.setParameters(getParametersMap(getArrayKeys()));
    env.put(ToolConstants.CFG_VALIDATE_WSDL, "all");
    env.put(ToolConstants.CFG_CMD_ARG, getArgument());
    WSDL11Validator wsdlValidator = new WSDL11Validator(null, env, getBus());
    return wsdlValidator.isValid();
}
Also used : ToolContext(org.apache.cxf.tools.common.ToolContext) WSDL11Validator(org.apache.cxf.tools.validator.internal.WSDL11Validator)

Example 3 with WSDL11Validator

use of org.apache.cxf.tools.validator.internal.WSDL11Validator in project cxf by apache.

the class WSDLValidator method execute.

public void execute(boolean exitOnFinish) {
    try {
        super.execute(exitOnFinish);
        if (!hasInfoOption()) {
            ToolContext env = getContext();
            env.setParameters(getParametersMap(getArrayKeys()));
            env.put(ToolConstants.CFG_VALIDATE_WSDL, "all");
            env.put(ToolConstants.CFG_CMD_ARG, getArgument());
            WSDL11Validator wsdlValidator = new WSDL11Validator(null, env, getBus());
            if (wsdlValidator.isValid()) {
                System.out.println("Passed Validation : Valid WSDL ");
            }
        }
    } catch (ToolException ex) {
        err.println("WSDLValidator Error : " + ex.getMessage());
        if (ex.getCause() instanceof BadUsageException) {
            printUsageException(TOOL_NAME, (BadUsageException) ex.getCause());
        }
        err.println();
        if (isVerboseOn()) {
            err.println("[+] Verbose turned on");
            err.println();
            ex.printStackTrace(err);
        }
    } catch (Exception ex) {
        err.println("WSDLValidator Error : " + ex.getMessage());
        err.println();
        if (isVerboseOn()) {
            err.println("[+] Verbose turned on");
            err.println();
            ex.printStackTrace(err);
        }
    }
}
Also used : BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException) ToolContext(org.apache.cxf.tools.common.ToolContext) WSDL11Validator(org.apache.cxf.tools.validator.internal.WSDL11Validator) ToolException(org.apache.cxf.tools.common.ToolException) ToolException(org.apache.cxf.tools.common.ToolException) BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException)

Aggregations

WSDL11Validator (org.apache.cxf.tools.validator.internal.WSDL11Validator)3 ToolContext (org.apache.cxf.tools.common.ToolContext)2 ToolException (org.apache.cxf.tools.common.ToolException)1 BadUsageException (org.apache.cxf.tools.common.toolspec.parser.BadUsageException)1