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();
}
}
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();
}
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);
}
}
}
Aggregations