Example usage for javax.xml.registry.infomodel Service getDescription

List of usage examples for javax.xml.registry.infomodel Service getDescription

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel Service getDescription.

Prototype

InternationalString getDescription() throws JAXRException;

Source Link

Document

Gets the textual description for this object.

Usage

From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java

public static BusinessService getBusinessServiceFromJAXRService(Service service) throws JAXRException {
    BusinessService bs = objectFactory.createBusinessService();
    try {/*from   w w w  .ja  v  a  2  s  .  c  o m*/
        InternationalString iname = service.getName();

        addNames(bs.getName(), iname);

        InternationalString idesc = service.getDescription();

        addDescriptions(bs.getDescription(), idesc);

        Organization o = service.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 (service.getKey() != null && service.getKey().getId() != null) {
            bs.setServiceKey(service.getKey().getId());
        } else {
            bs.setServiceKey("");
        }

        CategoryBag catBag = getCategoryBagFromClassifications(service.getClassifications());
        if (catBag != null) {
            bs.setCategoryBag(catBag);
        }

        //Add the ServiceBinding information
        BindingTemplates bt = getBindingTemplates(service.getServiceBindings());
        if (bt != null) {
            bs.setBindingTemplates(bt);
        }

        log.debug("BusinessService=" + bs.toString());
    } catch (Exception ud) {
        throw new JAXRException("Apache JAXR Impl:", ud);
    }
    return bs;
}