ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
ClassLoader antLoader = this.getClass().getClassLoader();
Thread.currentThread().setContextClassLoader(antLoader);
try
{
WSContractConsumer importer = WSContractConsumer.newInstance();
importer.setGenerateSource(keep);
importer.setExtension(extension);
if (destdir != null)
importer.setOutputDirectory(destdir);
if (sourcedestdir != null)
importer.setSourceDirectory(sourcedestdir);
if (targetPackage != null)
importer.setTargetPackage(targetPackage);
if (wsdlLocation != null)
importer.setWsdlLocation(wsdlLocation);
if (catalog != null)
importer.setCatalog(catalog);
if (bindingFiles != null && bindingFiles.size() > 0)
importer.setBindingFiles(bindingFiles);
if (target != null)
importer.setTarget(target);
log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
if (verbose)
{
importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
}
try
{
importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
importer.consume(wsdl);
}
catch (MalformedURLException e)
{
throw new BuildException(e, getLocation());
}