Package org.apache.ws.scout.model.uddi.v2

Examples of org.apache.ws.scout.model.uddi.v2.BusinessService


        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("A Test business");
        be.getName().add(n);
        be.setBusinessServices(new BusinessServices());
        BusinessService bs = new BusinessService();
        Description d = new Description();
        d.setValue(str256);
        bs.getDescription().add(d);
        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        be.getBusinessServices().getBusinessService().add(bs);

        sb.getBusinessEntity().add(be);
        try {
            BusinessDetail saveBusiness = publication.saveBusiness(sb);
View Full Code Here


        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("A Test business");
        be.getName().add(n);
        be.setBusinessServices(new BusinessServices());
        BusinessService bs = new BusinessService();
        Description d = new Description();
        d.setValue(str255);
        d.setLang(str27);
        bs.getDescription().add(d);
        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        be.getBusinessServices().getBusinessService().add(bs);

        sb.getBusinessEntity().add(be);
        try {
            BusinessDetail saveBusiness = publication.saveBusiness(sb);
View Full Code Here

        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("A Test business");
        be.getName().add(n);
        be.setBusinessServices(new BusinessServices());
        BusinessService bs = new BusinessService();
        Description d = new Description();
        d.setValue(str255);
        d.setLang(str26);
        bs.getDescription().add(d);
        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        be.getBusinessServices().getBusinessService().add(bs);

        sb.getBusinessEntity().add(be);
      
        BusinessDetail saveBusiness = publication.saveBusiness(sb);
View Full Code Here

                HttpResponse response = client.execute(httpGet);
               
               
                Assert.assertTrue(response.getStatusLine().getStatusCode() == 200);
                logger.info("Response content: " + response.getEntity().getContent());
                BusinessService unmarshal = JAXB.unmarshal(response.getEntity().getContent(), BusinessService.class);
                client.getConnectionManager().shutdown();
                Assert.assertNotNull(unmarshal);
                Assert.assertEquals(unmarshal.getServiceKey(), findService.getServiceInfos().getServiceInfo().get(0).getServiceKey());


        }
View Full Code Here

        //wsdlURL = wsdlDefinition.getDocumentBaseURI();
        WADL2UDDI wadl2UDDI = new WADL2UDDI(null, new URLLocalizerDefaultImpl(), properties);

        Assert.assertNotNull(wadl2UDDI);

        BusinessService businessServices = wadl2UDDI.createBusinessService(new QName("CXF.Sample.WADL.namespace", "Servicename"), app);

        Assert.assertNotNull(businessServices);
        Assert.assertNotNull(businessServices.getBindingTemplates());
        Assert.assertNotNull(businessServices.getName().get(0));
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0));
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0).getAccessPoint());
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0).getAccessPoint().getValue());




        PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();
View Full Code Here

        //wsdlURL = wsdlDefinition.getDocumentBaseURI();
        WADL2UDDI wadl2UDDI = new WADL2UDDI(null, new URLLocalizerDefaultImpl(), properties);

        Assert.assertNotNull(wadl2UDDI);

        BusinessService businessServices = wadl2UDDI.createBusinessService(new QName("CXF.Sample.WADL.namespace", "Servicename"), app);

        Assert.assertNotNull(businessServices);
        Assert.assertNotNull(businessServices.getBindingTemplates());
        Assert.assertNotNull(businessServices.getName().get(0));
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0));
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0).getAccessPoint());
        Assert.assertNotNull(businessServices.getBindingTemplates().getBindingTemplate().get(0).getAccessPoint().getValue());




        PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();
View Full Code Here

                return be;
        }

        private static BusinessServices getServices() {
                BusinessServices r = new BusinessServices();
                BusinessService x = new BusinessService();
                x.setBusinessKey(domainprefix+"businesskey");
                x.setServiceKey(domainprefix+"servicekey");
                x.setCategoryBag(getCatbag());
                x.getDescription().addAll(getDescriptions());
                x.getName().addAll(getNames());
                x.setBindingTemplates(getBindingTemplates());
                r.getBusinessService().add(x);
                return r;
        }
View Full Code Here

                BusinessServices businessServices = new BusinessServices();

                for (Object serviceName : wsdlDefinition.getAllServices().keySet()) {
                        QName serviceQName = (QName) serviceName;
                        Service service = wsdlDefinition.getService(serviceQName);
                        BusinessService businessService = null;
                        //add service
                        URL serviceUrl = null;
                        if (service.getPorts() != null && service.getPorts().size() > 0) {
                                for (Object portName : service.getPorts().keySet()) {
                                        businessService = registerBusinessService(serviceQName, (String) portName, serviceUrl, wsdlDefinition).getBusinessService();
View Full Code Here

        public ServiceRegistrationResponse registerBusinessService(QName serviceQName, String portName, URL serviceUrl, Definition wsdlDefinition) throws RemoteException, ConfigurationException, TransportException, WSDLException, MalformedURLException {

                String genericWSDLURL = wsdlDefinition.getDocumentBaseURI();   //TODO maybe point to repository version
                ServiceRegistrationResponse response = new ServiceRegistrationResponse();
                String serviceKey = UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart());
                BusinessService businessService = lookupService(serviceKey);
                if (businessService == null) {
                        List<TModel> tModels = new ArrayList<TModel>();
                        // Create the PortType tModels
                        Map<QName, PortType> portTypes = (Map<QName, PortType>) wsdlDefinition.getAllPortTypes();
                        tModels.addAll(createWSDLPortTypeTModels(genericWSDLURL, portTypes));
                        // Create the Binding tModels
                        Map<QName, Binding> bindings = (Map<QName, Binding>) wsdlDefinition.getAllBindings();
                        tModels.addAll(createWSDLBindingTModels(genericWSDLURL, bindings));
                        // Register these tModels
                        for (TModel tModel : tModels) {
                                clerk.register(tModel);
                        }
                        // Service
                        businessService = createBusinessService(serviceQName, wsdlDefinition);
                        // Register this Service
                        clerk.register(businessService);
                }
                //Add the BindingTemplate to this Service
                BindingTemplate binding = createWSDLBinding(serviceQName, portName, serviceUrl, wsdlDefinition);
                // Register BindingTemplate
                if (binding.getAccessPoint() != null) {
                        clerk.register(binding);
                        if (businessService.getBindingTemplates() == null) {
                                businessService.setBindingTemplates(new BindingTemplates());
                        }
                        businessService.getBindingTemplates().getBindingTemplate().add(binding);
                        response.setBindingKey(binding.getBindingKey());
                }
                response.setBusinessService(businessService);
                return response;
        }
View Full Code Here

        }

        public String unRegisterBusinessService(QName serviceName, String portName, URL serviceUrl) throws RemoteException, ConfigurationException, TransportException {

                String serviceKey = UDDIKeyConvention.getServiceKey(properties, serviceName.getLocalPart());
                BusinessService service = lookupService(serviceKey);
                boolean isRemoveServiceIfNoTemplates = true;
                String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceName, portName, serviceUrl);
                //check if this bindingKey is in the service's binding templates
                for (BindingTemplate bindingTemplate : service.getBindingTemplates().getBindingTemplate()) {
                        if (bindingKey.equals(bindingTemplate.getBindingKey())) {
                                clerk.unRegisterBinding(bindingKey);
                                //if this is the last binding for this service, and
                                if (service.getBindingTemplates().getBindingTemplate().size() == 1 && isRemoveServiceIfNoTemplates) {
                                        clerk.unRegisterService(serviceKey);
                                        if (bindingTemplate.getTModelInstanceDetails() != null
                                                && bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo() != null) {
                                                for (TModelInstanceInfo tModelInstanceInfo : bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo()) {
                                                        String tModelKey = tModelInstanceInfo.getTModelKey();
View Full Code Here

TOP

Related Classes of org.apache.ws.scout.model.uddi.v2.BusinessService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.