ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
wsdl.serialize(baos);
InputStream in = new ByteArrayInputStream(baos.toByteArray());
InputSource inputSource = new InputSource(in);
WSDLLocator wsdlLocator = new CustomWSDLLocator(inputSource,baseUri);
Document doc = null;
try {
doc = XMLUtils.newDocument(inputSource);
} catch (ParserConfigurationException e) {
handleException("Parser Configuration Error", e);