@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!getModelInternal().getNamespacesToWSDLs().isEmpty()) { String docsDir = getDocsDir() == null ? "" : getDocsDir(); if (!docsDir.startsWith("/")) { docsDir = "/" + docsDir; } while (docsDir.endsWith("/")) { docsDir = docsDir.substring(0, docsDir.length() - 1); } for (WsdlInfo wsdlInfo : getModelInternal().getNamespacesToWSDLs().values()) { Object filename = wsdlInfo.getProperty("filename"); if (filename != null) { wsdlInfo.setProperty("redirectLocation", docsDir + "/" + filename); } } } EnunciateConfiguration config = model.getEnunciateConfig(); for (RootResource resource : model.getRootResources()) { for (ResourceMethod resourceMethod : resource.getResourceMethods(true)) { if (!resourceMethod.getMetaData().containsKey("defaultSubcontext")) { //if we don't have the defaultSubcontext set by some other jax-rs implementation provider module //then we need to set it ourselves. resourceMethod.putMetaData("defaultSubcontext", config == null ? "/rest" : config.getDefaultRestSubcontext()); } } } }
if (prefix != null) { String file = prefix + ".wsdl"; wsdlInfo.setProperty("filename", file); wsdlInfo.setProperty("inlineSchema", inlineWSDLSchemas); wsdlInfo.setProperty("filename", customConfig.getFile()); wsdlInfo.setProperty("inlineSchema", customConfig.isInlineSchema()); String file = (String) wsdl.getProperty("filename"); File wsdlFile = new File(artifactDir, file); wsdl.setProperty("file", wsdlFile);