Bus bus = BusFactory.getDefaultBus();
OASISCatalogManager catalog = new OASISCatalogManager();
bus.setExtension(catalog, OASISCatalogManager.class);
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);
}