public static void removeServiceEndpoints(TargetService service) throws Exception {
TargetService oldService = getService(service.getEpr());
if (oldService == null) {
throw new DiscoveryException("Error while updating discovery metadata. No service " +
"exists with the ID: " + service.getEpr().getAddress());
}
// When marking an existing service as inactive try to hold on to
// the old metadata of the service