ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
ClassLoader antLoader = this.getClass().getClassLoader();
Thread.currentThread().setContextClassLoader(antLoader);
try
{
WSContractProvider gen = WSContractProvider.newInstance(
getClasspathLoader(antLoader)
);
if (verbose)
gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
gen.setGenerateSource(keep);
gen.setGenerateWsdl(genwsdl);
if (destdir != null)
gen.setOutputDirectory(destdir);
if (resourcedestdir != null)
gen.setResourceDirectory(resourcedestdir);
if (sourcedestdir != null)
gen.setSourceDirectory(sourcedestdir);
log("Generating from endpoint: " + sei, Project.MSG_INFO);
gen.provide(sei);
}
finally
{
Thread.currentThread().setContextClassLoader(prevCL);
}