* @param in
* @throws WSDLException
*/
private Definition readInTheWSDLFile(InputStream in) throws WSDLException {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
// switch off the verbose mode for all usecases
reader.setFeature(JAVAX_WSDL_VERBOSE_MODE_KEY, false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition def;
// if the custem resolver is present then use it
if (customWSDLResolver != null) {
// make sure the wsdl definition has the URI for the base document set
def = reader.readWSDL(customWSDLResolver);
def.setDocumentBaseURI(customWSDLResolver.getBaseURI());
return def;
} else {
Document doc;
try {
doc = XMLUtils.newDocument(in);
} catch (ParserConfigurationException e) {
throw new WSDLException(WSDLException.PARSER_ERROR,
"Parser Configuration Error", e);
} catch (SAXException e) {
throw new WSDLException(WSDLException.PARSER_ERROR,
"Parser SAX Error", e);
} catch (IOException e) {
throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error",
e);
}
// Log when and from where the WSDL is loaded.
if (log.isDebugEnabled()) {
log.debug("Reading 1.1 WSDL with base uri = " + getBaseUri());
log.debug(" the document base uri = " + getDocumentBaseUri());
log.trace(" the stack at this point is: " + stackToString());
}
def = reader.readWSDL(getBaseUri(), doc);
def.setDocumentBaseURI(getDocumentBaseUri());
return def;
}
}