service.setDescription(blm.createInternationalString("Registry Test Service Description"));
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:testcategory");
Classification classification = blm.createClassification(cScheme, "category", "registry");
service.addClassification(classification);
organization.addService(service);
Collection<Service> services = new ArrayList<Service>();
services.add(service);
BulkResponse br = blm.saveServices(services);
assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
} catch (JAXRException je) {
fail(je.getMessage());
}
//find Service
try
{
RegistryService rs = connection.getRegistryService();
bqm = rs.getBusinessQueryManager();
blm = rs.getBusinessLifeCycleManager();
Finder finder = new Finder(bqm, uddiversion);
//Find the service
Service service = finder.findService("registry","Registry Test ServiceName", blm);
assertEquals("Registry Test ServiceName", service.getName().getValue());
} catch (JAXRException je) {
fail(je.getMessage());
}
//publish serviceBinding
try {
RegistryService rs = connection.getRegistryService();
bqm = rs.getBusinessQueryManager();
blm = rs.getBusinessLifeCycleManager();
Finder finder = new Finder(bqm, uddiversion);
//Find the service
Service service = finder.findService("registry","Registry Test ServiceName", blm);
ServiceBinding serviceBinding = blm.createServiceBinding();
serviceBinding.setDescription(blm.createInternationalString("eprDescription"));
String xml = "<epr>epr uri</epr>";
serviceBinding.setAccessURI(xml);
ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
serviceBindings.add(serviceBinding);
service.addServiceBindings(serviceBindings);
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:testcategory");
Classification classification = blm.createClassification(cScheme, "category", "registry");
service.addClassification(classification);
BulkResponse br = blm.saveServiceBindings(serviceBindings);
assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
BulkResponse br2 = blm.saveServiceBindings(serviceBindings); //Save one more