return readInTheWSDLFile(document);
}
private Description readInTheWSDLFile(Document document) throws WSDLException {
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
if (customWSDLResolver != null) {
reader.setURIResolver(customWSDLResolver);
}
// This turns on WSDL validation which is set off by default.
reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
WSDLSource wsdlSource = reader.createWSDLSource();
wsdlSource.setSource(document.getDocumentElement());
String uri = getBaseUri();
if (uri != null && !"".equals(uri)) {
try {
wsdlSource.setBaseURI(new URI(uri));
} catch (URISyntaxException e) {
File f = new File(uri);
if(f.exists()) {
wsdlSource.setBaseURI(f.toURI());
} else {
log.error(e.toString(), e);
}
}
}
if (log.isDebugEnabled()) {
log.debug("Reading 2.0 WSDL with wsdl uri = " + wsdlURI);
log.trace(" the stack at this point is: " + stackToString());
}
return reader.readWSDL(wsdlSource);
}