if (h.getTypes().contains(WSDiscoveryClient.SERVICE_QNAME)
|| h.getTypes().contains(new QName("", WSDiscoveryClient.SERVICE_QNAME.getLocalPart()))) {
// A DiscoveryProxy wants us to flip to managed mode
try {
client.close();
client = new WSDiscoveryClient(h.getXAddrs().get(0));
} catch (IOException e) {
e.printStackTrace();
}
}
} else if (obj instanceof ByeType) {
ByeType h = (ByeType)obj;
if (h.getTypes().contains(WSDiscoveryClient.SERVICE_QNAME)
|| h.getTypes().contains(new QName("", WSDiscoveryClient.SERVICE_QNAME.getLocalPart()))) {
// Our proxy has gone away, flip to ad-hoc
try {
if (client.getAddress().equals(h.getXAddrs().get(0))) {
client.close();
client = new WSDiscoveryClient();
}
} catch (IOException e) {
e.printStackTrace();
}
}