try {
tx.begin();
UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
ValidatePublish validator = new ValidatePublish(publisher);
validator.validateSaveBinding(em, body, null);
BindingDetail result = new BindingDetail();
result.setListDescription(new ListDescription());
List<org.uddi.api_v3.BindingTemplate> apiBindingTemplateList = body.getBindingTemplate();
for (org.uddi.api_v3.BindingTemplate apiBindingTemplate : apiBindingTemplateList) {
org.apache.juddi.model.BindingTemplate modelBindingTemplate = new org.apache.juddi.model.BindingTemplate();
org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
modelBusinessService.setEntityKey(apiBindingTemplate.getServiceKey());
MappingApiToModel.mapBindingTemplate(apiBindingTemplate, modelBindingTemplate, modelBusinessService);
setOperationalInfo(em, modelBindingTemplate, publisher, false);
em.persist(modelBindingTemplate);
result.getBindingTemplate().add(apiBindingTemplate);
result.getListDescription().setActualCount(result.getListDescription().getActualCount()+1);
result.getListDescription().setIncludeCount(result.getListDescription().getIncludeCount()+1);
validator.validateSaveBindingMax(em, modelBindingTemplate.getBusinessService().getEntityKey());
}
tx.commit();
long procTime = System.currentTimeMillis() - startTime;
serviceCounter.update(PublicationQuery.SAVE_BINDING,