juddiApiService.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
logger.debug("Saved ClientSubscriptionInfo to the default UDDI server");
//the listening server is ready; now add the subscription
Transport transport = WebHelper.getTransport(session.getServletContext(), clerk.getUDDINode());
UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
List<org.uddi.sub_v3.Subscription> subscriptionList = new ArrayList<org.uddi.sub_v3.Subscription>();
org.uddi.sub_v3.Subscription subscription = new org.uddi.sub_v3.Subscription();
if (!"".equals(modelSubscription.getBindingKey())) {
subscription.setBindingKey(modelSubscription.getBindingKey());
}
subscription.setBrief(modelSubscription.getBrief());
if (!"".equals(modelSubscription.getExpiresAfter())) {
XMLGregorianCalendar calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(modelSubscription.getExpiresAfter());
subscription.setExpiresAfter(calendar);
}
subscription.setMaxEntities(modelSubscription.getMaxEntities());
if (!"".equals(modelSubscription.getNotificationInterval())) {
Duration duration = DatatypeFactory.newInstance().newDuration(modelSubscription.getNotificationInterval());
subscription.setNotificationInterval(duration);
}
if (!"".equals(modelSubscription.getSubscriptionFilter())) {
SubscriptionFilter subscriptionFilter = (SubscriptionFilter)JAXBMarshaller.unmarshallFromString(modelSubscription.getSubscriptionFilter(), JAXBMarshaller.PACKAGE_SUBSCRIPTION);
subscription.setSubscriptionFilter(subscriptionFilter);
}
subscription.setSubscriptionKey(modelSubscription.getSubscriptionKey());
subscriptionList.add(subscription);
Holder<List<org.uddi.sub_v3.Subscription>> subscriptionHolder = new Holder<List<org.uddi.sub_v3.Subscription>>();
subscriptionHolder.value = subscriptionList;
String authToken = (String) session.getAttribute("token-" + clerk.getName());
subscriptionService.saveSubscription(authToken, subscriptionHolder);
subscription = subscriptionHolder.value.get(0);
String expiresAfter = null;
if (subscription.getExpiresAfter()!=null) expiresAfter = subscription.getExpiresAfter().toString();
String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(subscription.getSubscriptionFilter()), "org.uddi.sub_v3");
Subscription savedModelSubscription = new Subscription(