SubscriptionResponse response = new SubscriptionResponse();
logger.info("Sending saveSubscriptions request..");
try {
//before sending this we need to ready the listener node
UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
UDDINode homeNode = WebHelper.getUDDIHomeNode(session.getServletContext());
UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
UDDIClerk toClerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getToClerkName());
if (toClerk==null) {
String publisher = (String) session.getAttribute("UserName");
Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
for (UDDIClerk uddiClerk : clerks.values()) {
if (publisher.equals(uddiClerk.getPublisher())
&& homeNode.getName().equals(uddiClerk.getUDDINode().getName())) {
toClerk = uddiClerk;
}