return pa;
}
public static BusinessService getBusinessServiceFromJAXRService(
Service serve) throws JAXRException {
BusinessService bs = BusinessService.Factory.newInstance();
try {
InternationalString iname = ((RegistryObject) serve).getName();
for (LocalizedString locName : iname.getLocalizedStrings()) {
Name name = bs.addNewName();
name.setStringValue(locName.getValue());
name.setLang(locName.getLocale().getLanguage());
}
InternationalString idesc = ((RegistryObject) serve).getDescription();
if (idesc != null) {
for (LocalizedString locName : idesc.getLocalizedStrings()) {
Description desc = bs.addNewDescription();
desc.setStringValue(locName.getValue());
desc.setLang(locName.getLocale().getLanguage());
}
}
Organization o = serve.getProvidingOrganization();
/*
* there may not always be a key...
*/
if (o != null) {
Key k = o.getKey();
if (k != null && k.getId() != null) {
bs.setBusinessKey(k.getId());
}
} else {
/*
* gmj - I *think* this is the right thing to do
*/
throw new JAXRException(
"Service has no associated organization");
}
if (serve.getKey() != null && serve.getKey().getId() != null) {
bs.setServiceKey(serve.getKey().getId());
} else {
bs.setServiceKey("");
}
CategoryBag catBag = getCategoryBagFromClassifications(serve.getClassifications());
if (catBag!=null) {
bs.setCategoryBag(catBag);
}
//Add the ServiceBinding information
BindingTemplates bt = getBindingTemplates(serve.getServiceBindings());
if (bt != null) {
bs.setBindingTemplates(bt);
}
log.debug("BusinessService=" + bs.toString());
} catch (Exception ud) {
throw new JAXRException("Apache JAXR Impl:", ud);
}
return bs;
}