public DefinitionCacheConfig cacheDefinition(WsdlLoader loader) throws Throwable { log.debug("Caching definition for [" + loader.getBaseURI() + "]"); if (getConfig().isSetDefinitionCache()) getConfig().unsetDefinitionCache(); DefinitionCacheConfig definitionCache = null; try { definitionCache = getConfig().addNewDefinitionCache(); definitionCache.set(WsdlUtils.cacheWsdl(loader)); } catch (Throwable e) { getConfig().unsetDefinitionCache(); throw e; } return definitionCache; }