}
}
//change the import location in wsdl file
OutputStream wsdloutput = new BufferedOutputStream(new FileOutputStream(wsdlFile));
WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
wsdlWriter.writeWSDL(def, bout);
Element defEle = XMLUtils.parse(bout.toByteArray()).getDocumentElement();
List<Element> xsdElements = DOMUtils.findAllElementsByTagNameNS(defEle,
WSDLConstants.NS_SCHEMA_XSD,
"schema");
for (Element xsdEle : xsdElements) {
updateImports(xsdEle, sourceMap);
}
updateWSDLImports(defEle, importWSDLMap);
DOMUtils.writeXml(defEle, wsdloutput);
wsdloutput.close();
for (Definition importDef : defs) {
File importWsdlFile = new File(outputdir, importWSDLMap.get(importDef.getTargetNamespace()));
OutputStream wsdlOs = new BufferedOutputStream(new FileOutputStream(importWsdlFile));
bout = new ByteArrayOutputStream();
wsdlWriter.writeWSDL(importDef, bout);
Element importEle = XMLUtils.parse(bout.toByteArray()).getDocumentElement();
xsdElements = DOMUtils.findAllElementsByTagNameNS(importEle, WSDLConstants.NS_SCHEMA_XSD,
"schema");
for (Element xsdEle : xsdElements) {