org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)EntityCreator.buildFromDoc(serviceXML, "org.uddi.api_v3");
String serviceName = bsIn.getName().get(0).getValue();
String bindingKey = bsIn.getBindingTemplates().getBindingTemplate().get(0).getBindingKey();
for (int i=0; i<numberOfCopies; i++) {
// save the entity
SaveService ss = new SaveService();
ss.setAuthInfo(authInfo);
bsIn.getName().get(0).setValue(serviceName + "-" + i);
bsIn.setServiceKey(serviceKey + "-" + i);
bsIn.getBindingTemplates().getBindingTemplate().get(0).setBindingKey(bindingKey + "-" + i);
ss.getBusinessService().add(bsIn);
publication.saveService(ss);
logger.debug("Add service with key " + bsIn.getServiceKey());
}
}
catch(Exception e) {