context.put(Definition.class, definition);
builder.validate(definition);
WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
if (context.isVerbose()) {
serviceBuilder.setUnwrapLogLevel(Level.INFO);
}
serviceBuilder.setIgnoreUnknownBindings(true);
String allowRefs = (String)context.get(ToolConstants.CFG_ALLOW_ELEMENT_REFS);
if (!StringUtils.isEmpty(allowRefs)
|| context.optionSet(ToolConstants.CFG_ALLOW_ELEMENT_REFS)) {
if (allowRefs.length() > 0 && allowRefs.charAt(0) == '=') {
allowRefs = allowRefs.substring(1);
}
if (StringUtils.isEmpty(allowRefs)) {
allowRefs = "true";
}
serviceBuilder.setAllowElementRefs(Boolean.valueOf(allowRefs));
}
String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);
if (serviceName != null) {
List<ServiceInfo> services = serviceBuilder
.buildServices(definition, getServiceQName(definition));
serviceList.addAll(services);
} else if (definition.getServices().size() > 0) {
serviceList = serviceBuilder.buildServices(definition);
} else {
serviceList = serviceBuilder.buildMockServices(definition);
}
//remove definition from cache so that won't fail when encounter same wsdl file
//name but different wsdl content(CXF-3340)
getBus().getExtension(WSDLManager.class).removeDefinition(definition);
} else {