I wanted to check WSDL url is valid or not from Java code. So that I can use another url based on that.
So I am checking the code like this.
private boolean isValidWsdlURL(String wsdlUrl)
{
UrlValidator urlValidator = new UrlValidator();
if(urlValidator.isValid(wsdlUrl))
{
return true;
}
logger.info("WSDL URL is not valid...");
return false;
}
But its alwys returning false though I have valid URL. WSDL URL Ex: http://www.sample.com/MyWsdlService?wsdl
Because URL ends with ?wsdl How to check the code? Looks we need only "http://www.sample.com" for UrlValidator to pass.