// Get the wsdl definition and write it to the wsdl publish location
try
{
Writer fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
URL wsdlPublishURL = wsdlFile.toURL();
log.info("WSDL published to: " + wsdlPublishURL);
// udpate the wsdl file location
serviceMetaData.setWsdlLocation(wsdlFile.toURL());
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
if (wsdl11Definition != null)
{
List<String> published = new LinkedList<String>();
publishWsdlImports(wsdlFile.toURL(), wsdl11Definition, published);
// Publish XMLSchema imports
Document document = wsdlDefinitions.getWsdlDocument();
publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement(), published);
}
else
{
throw new NotImplementedException("WSDL-2.0 imports");