}
final File wsitOut = new File(outputdir.getAbsoluteFile(), outputfile);
FileUtils.copyFile(wsdl, wsitOut);
WsitDocument wsitDoc = WsitDocument.parse(wsitOut, true);
if (null != policy)
{
getLog().debug("Using policies from " + policy.getAbsolutePath());
wsitDoc.mergePolicy(policy);
}
else
{
Document defaultPolicy = createDefaultPolicyDocument();
wsitDoc.mergePolicy(defaultPolicy);
}
wsitDoc.setBindingPolicy(this.bindingpolicy);
getLog().info("Creating " + wsitOut.getAbsolutePath());
wsitDoc.save(wsitOut);
//Create a new wsit-client.xml or update it if it exists.
final File clientOut = new File(outputdir.getAbsoluteFile(), "wsit-client.xml");
final WsitDocument clientDoc;
if (clientOut.exists())
{
getLog().info("Updating WSIT client configuration " + clientOut.getAbsolutePath());
clientDoc = WsitDocument.parse(clientOut);
}
else
{
getLog().info("Creating WSIT client configuration " + clientOut.getAbsolutePath());
clientDoc = WsitDocument.newDocument("mainclientconfig");
}
clientDoc.importWsitDocument(wsitDoc, wsitOut.getName());
clientDoc.save(clientOut);
project.addCompileSourceRoot(outputdir.getAbsolutePath());
Resource resource = new Resource();
resource.setDirectory(outputdir.getAbsolutePath());
project.addResource(resource);