JarWSDLLocator implements WSDLLocator { @Override public InputSource getImportInputSource(String parentLocation, String importLocation) { String resolvedImportLocation; URI importURI = URI.create(importLocation); if (importURI.isAbsolute()) { resolvedImportLocation = importLocation; } else { resolvedImportLocation = parentLocation.substring(0, parentLocation.lastIndexOf('/') + 1) + importLocation; } try { importResource = new PathMatchingResourcePatternResolver().getResource(resolvedImportLocation); return new InputSource(importResource.getInputStream()); } catch (IOException e) { log.warn(String.format("Failed to resolve imported WSDL schema path location '%s'", importLocation), e); return null; } } JarWSDLLocator(Resource wsdl); @Override InputSource getBaseInputSource(); @Override InputSource getImportInputSource(String parentLocation, String importLocation); @Override String getBaseURI(); @Override String getLatestImportURI(); @Override void close();  }
@Test public void testGetImportInputSource() throws Exception { JarWSDLLocator locator = new JarWSDLLocator(wsdl); Assert.assertNotNull(locator.getBaseInputSource()); Assert.assertNotNull(locator.getBaseURI()); Assert.assertTrue(locator.getBaseURI().endsWith("com/consol/citrus/validation/SampleService.wsdl")); Assert.assertNull(locator.getLatestImportURI()); Assert.assertNull(locator.getImportInputSource(locator.getBaseURI(), "invalid.xsd")); Assert.assertTrue(locator.getLatestImportURI().endsWith("com/consol/citrus/validation/invalid.xsd")); Assert.assertNotNull(locator.getImportInputSource(locator.getBaseURI(), "types.xsd")); Assert.assertTrue(locator.getLatestImportURI().endsWith("com/consol/citrus/validation/types.xsd")); }