try {
try {
UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
Transport transport = WebHelper.getTransport(session.getServletContext(), clerk.getUDDINode());
UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
DeleteSubscription deleteSubscription = new DeleteSubscription();
String authToken = (String) session.getAttribute("token-" + clerk.getName());
deleteSubscription.setAuthInfo(authToken);
deleteSubscription.getSubscriptionKey().add(modelSubscription.getSubscriptionKey());
subscriptionService.deleteSubscription(deleteSubscription);
logger.info("Deleted Subscription " + modelSubscription.getSubscriptionKey()
+ " from UDDI server " + clerk.getUDDINode().getName());
} catch (Exception e) {
error = "Could not delete subscription. Reason: " + e.getMessage();
logger.error(error, e);
}
try {
//now remove it from the listener UDDI server too
Transport transport = WebHelper.getTransport(session.getServletContext());
JUDDIApiPortType juddiApiService = transport.getJUDDIApiService();
DeleteClientSubscriptionInfo deleteClientSubscriptionInfo = new DeleteClientSubscriptionInfo();
deleteClientSubscriptionInfo.setAuthInfo(userAuthToken);
deleteClientSubscriptionInfo.getSubscriptionKey().add(modelSubscription.getSubscriptionKey());
//remove the clientSubscription to the listening UDDI default server.