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

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


            be.getName().add(bsn);

            BusinessService bs = new BusinessService();
            Name n = new Name();
            n.setValue("A a redirected business service");
            BindingTemplate bt = new BindingTemplate();
            bt.setAccessPoint(new AccessPoint());
            bt.getAccessPoint().setUseType(AccessPointType.BINDING_TEMPLATE.toString());
            bt.getAccessPoint().setValue("uddi:" + UUID.randomUUID().toString());
            bs.getName().add(n);
            bs.setBindingTemplates(new BindingTemplates());
            bs.getBindingTemplates().getBindingTemplate().add(bt);
            be.setBusinessServices(new BusinessServices());
            be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here


        BusinessService bs = new BusinessService();

        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        BindingTemplate bt = new BindingTemplate();
        bs.setBindingTemplates(new BindingTemplates());

        bt.setHostingRedirector(new HostingRedirector());
        bt.getHostingRedirector().setBindingKey(str256);
        bs.getBindingTemplates().getBindingTemplate().add(bt);

        be.getBusinessServices().getBusinessService().add(bs);

        sb.getBusinessEntity().add(be);
View Full Code Here

        BusinessService bs = new BusinessService();

        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        BindingTemplate bt = new BindingTemplate();
        bs.setBindingTemplates(new BindingTemplates());
        bt.setAccessPoint(new AccessPoint());
        bt.getAccessPoint().setValue(str4096);

        bs.getBindingTemplates().getBindingTemplate().add(bt);

        be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

        BusinessService bs = new BusinessService();

        n = new Name();
        n.setValue(str255);
        bs.getName().add(n);
        BindingTemplate bt = new BindingTemplate();

        bs.setBindingTemplates(new BindingTemplates());
        bt.setAccessPoint(new AccessPoint());
        bt.getAccessPoint().setValue(str4097);

        bs.getBindingTemplates().getBindingTemplate().add(bt);

        be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

    QName serviceName = new QName ("http://www.jboss.org/bpel/examples/wsdl", "HelloService");
    URL serviceUrl =  new URL("http://localhost/sample");
   
    // Reading the WSDL
    Definition wsdlDefinition = rw.readWSDL("bpel/HelloWorld.wsdl");
      BindingTemplate binding = bpel2UDDI.createBPELBinding(serviceName, portName, serviceUrl, wsdlDefinition);
     
    System.out.println("***** WSDL Port BindingTemplate: " + binding.getBindingKey());
                if (serialize)
    System.out.println(pBinding.print(binding));
   
    Assert.assertNotNull(binding.getTModelInstanceDetails());
  }
View Full Code Here

        @Test
        public void InquiryREST_GET_Binding() throws Exception {
                Assume.assumeTrue(TckPublisher.isInquiryRestEnabled());
               
                BindingTemplate bt = getFirstBindingTemplate();
                Assume.assumeTrue(bt != null);
               
                String url = manager.getClientConfig().getHomeNode().getInquiry_REST_Url();

                Assume.assumeNotNull(url);
                HttpClient client = new DefaultHttpClient();
                HttpGet httpGet = new HttpGet(url + "?bindingKey=" + bt.getBindingKey());
                logger.info("Fetching " + httpGet.getURI());
                HttpResponse response = client.execute(httpGet);
               
                Assert.assertTrue(response.getStatusLine().getStatusCode() == 200);
                logger.info("Response content: " + response.getEntity().getContent());
                BindingTemplate unmarshal = JAXB.unmarshal(response.getEntity().getContent(), BindingTemplate.class);
                client.getConnectionManager().shutdown();
                Assert.assertNotNull(unmarshal);
                Assert.assertEquals(unmarshal.getServiceKey(), bt.getServiceKey());
                Assert.assertEquals(unmarshal.getBindingKey(), bt.getBindingKey());


        }
View Full Code Here

                return r;
        }

        private static BindingTemplates getBindingTemplates() {
                BindingTemplates bt = new BindingTemplates();
                BindingTemplate t = new BindingTemplate();
                t.setAccessPoint(new AccessPoint("http://localhost", AccessPointType.END_POINT.toString()));
                t.setBindingKey(domainprefix+"binding");
//                t.setCategoryBag(getCatbag());
                t.getDescription().addAll(getDescriptions());
                t.setHostingRedirector(null);
                t.setServiceKey(domainprefix+"servicekey");
               
                t.setTModelInstanceDetails(getTID());
               
                bt.getBindingTemplate().add(t);
                return bt;
        }
View Full Code Here

                        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

                        //add the bindingTemplates
                        URL serviceUrl = null;
                        if (service.getPorts() != null && service.getPorts().size() > 0) {
                                businessService.setBindingTemplates(new BindingTemplates());
                                for (Object portName : service.getPorts().keySet()) {
                                        BindingTemplate bindingTemplate = createWSDLBinding(serviceQName, (String) portName, serviceUrl, wsdlDefinition);
                                        businessService.getBindingTemplates().getBindingTemplate().add(bindingTemplate);
                                }
                        }
                        businessServices.getBusinessService().add(businessService);
                }
View Full Code Here

                return service;
        }

        protected BindingTemplate createWSDLBinding(QName serviceQName, String portName, URL serviceUrl, Definition wsdlDefinition) throws MalformedURLException {

                BindingTemplate bindingTemplate = new BindingTemplate();
                // Set BusinessService Key
                bindingTemplate.setServiceKey(UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart()));

                if (serviceUrl != null) {
                        // Set AccessPoint
                        AccessPoint accessPoint = new AccessPoint();
                        accessPoint.setUseType(AccessPointType.END_POINT.toString());
                        accessPoint.setValue(urlLocalizer.rewrite(serviceUrl));
                        bindingTemplate.setAccessPoint(accessPoint);
                        // Set Binding Key
                        String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, serviceUrl);
                        bindingTemplate.setBindingKey(bindingKey);
                }

                Service service = wsdlDefinition.getService(serviceQName);
                if (service != null) {
                        TModelInstanceDetails tModelInstanceDetails = new TModelInstanceDetails();

                        Port port = service.getPort(portName);
                        if (port != null) {
                                if (serviceUrl == null) {
                                        for (Object element : port.getExtensibilityElements()) {
                                                String location = null;
                                                if (element instanceof SOAPAddress) {
                                                        SOAPAddress address = (SOAPAddress) element;
                                                        location = urlLocalizer.rewrite(new URL(address.getLocationURI()));
                                                } else if (element instanceof HTTPAddress) {
                                                        HTTPAddress address = (HTTPAddress) element;
                                                        urlLocalizer.rewrite(new URL(location = address.getLocationURI()));
                                                } else if (element instanceof SOAP12Address) {
                                                        SOAP12Address address = (SOAP12Address) element;
                                                        location = urlLocalizer.rewrite(new URL(address.getLocationURI()));
                                                }
                                                if (location != null) {
                                                        try {
                                                                URL locationURI = new URL(location);
                                                                AccessPoint accessPoint = new AccessPoint();
                                                                accessPoint.setUseType(AccessPointType.END_POINT.toString());
                                                                accessPoint.setValue(urlLocalizer.rewrite(locationURI));
                                                                bindingTemplate.setAccessPoint(accessPoint);
                                                                // Set Binding Key
                                                                String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, locationURI);
                                                                bindingTemplate.setBindingKey(bindingKey);
                                                                break;
                                                        } catch (MalformedURLException e) {
                                                                log.error(e.getMessage());
                                                        }
                                                }
                                        }

                                }
                                Binding binding = port.getBinding();
                                // Set the Binding Description
                                String bindingDescription = properties.getProperty(Property.BINDING_DESCRIPTION, Property.DEFAULT_BINDING_DESCRIPTION);
                                // Override with the service description from the WSDL if present
                                Element docElement = binding.getDocumentationElement();
                                if (docElement != null && docElement.getTextContent() != null) {
                                        bindingDescription = docElement.getTextContent();
                                }

                                bindingTemplate.getDescription().addAll(Common2UDDI.mapDescription(bindingDescription, lang));

                                // reference wsdl:binding tModel
                                TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
                                tModelInstanceInfoBinding.setTModelKey(keyDomainURI + binding.getQName().getLocalPart());
                                InstanceDetails instanceDetails = new InstanceDetails();
                                instanceDetails.setInstanceParms(portName);
                                tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);

                                tModelInstanceInfoBinding.getDescription().addAll(Common2UDDI.mapDescription("The wsdl:binding that this wsdl:port implements. " + bindingDescription
                                        + " The instanceParms specifies the port local name.", lang));
                                tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoBinding);

                                // reference wsdl:portType tModel
                                PortType portType = binding.getPortType();
                                TModelInstanceInfo tModelInstanceInfoPortType = new TModelInstanceInfo();
                                tModelInstanceInfoPortType.setTModelKey(keyDomainURI + portType.getQName().getLocalPart());
                                String portTypeDescription = "";
                                docElement = portType.getDocumentationElement();
                                if (docElement != null && docElement.getTextContent() != null) {
                                        portTypeDescription = docElement.getTextContent();
                                }

                                tModelInstanceInfoPortType.getDescription().addAll(Common2UDDI.mapDescription("The wsdl:portType that this wsdl:port implements." + portTypeDescription, lang));
                                tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoPortType);

                                bindingTemplate.setTModelInstanceDetails(tModelInstanceDetails);
                        } else {
                                log.error("Could not find Port with portName: " + portName);
                        }
                } else {
                        log.error("Could not find Service with serviceName: " + serviceQName.getLocalPart());
View Full Code Here

TOP

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

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.