// prevent cache from papering over the lack of a schema.
WSDLManagerImpl mgr = (WSDLManagerImpl)bus.getExtension(WSDLManager.class);
mgr.setDisableSchemaCache(true);
try {
SOAPService service = new SOAPService(wsdl, serviceName);
service.getPort(portName, Greeter.class);
fail("Test did not fail as expected");
} catch (WebServiceException e) {
// ignore
}
// update catalog dynamically now
URL jaxwscatalog =
getClass().getResource("/META-INF/jax-ws-catalog.xml");
assertNotNull(jaxwscatalog);
catalog.loadCatalog(jaxwscatalog);
SOAPService service = new SOAPService(wsdl, serviceName);
Greeter greeter = service.getPort(portName, Greeter.class);
assertNotNull(greeter);
}