}
public static Service getService(BusinessService bs, LifeCycleManager lcm)
throws JAXRException
{
Service serve = new ServiceImpl(lcm);
String keystr = bs.getServiceKey();
if (keystr != null)
{
serve.setKey(lcm.createKey(keystr));
}
Name[] namearr = bs.getNameArray();
Name n = namearr != null && namearr.length > 0 ? namearr[0] : null;
if (n != null) {
String name = n.getStringValue();
serve.setName(lcm.createInternationalString(getLocale(n.getLang()), name));
}
Description[] descarr = bs.getDescriptionArray();
Description desc = descarr != null && descarr.length > 0 ? descarr[0] : null;
if (desc != null ) {
serve.setDescription(lcm.createInternationalString(getLocale(desc.getLang()), desc.getStringValue()));
}
//Populate the ServiceBindings for this Service
BindingTemplates bts = bs.getBindingTemplates();
BindingTemplate[] btarr = bts != null ? bts.getBindingTemplateArray() : null;
for (int i = 0; btarr != null && i < btarr.length; i++)
{
BindingTemplate bindingTemplate = (BindingTemplate)btarr[i];
serve.addServiceBinding(getServiceBinding(bindingTemplate, lcm));
}
serve.addClassifications(getClassifications(bs.getCategoryBag(), lcm));
return serve;
}