Package org.uddi.api_v3

Examples of org.uddi.api_v3.BindingTemplate


                   registrationInfo.getWsdlDefinition()).getBusinessService();
        serviceLocator.addService(service.getServiceKey());
       
      } else if (RegistrationType.BPEL.equals(registrationInfo.getRegistrationType())) {
        BPEL2UDDI bpel2UDDI = new BPEL2UDDI(clerk, urlLocalizer, properties);
        BindingTemplate binding = bpel2UDDI.register(registrationInfo.getServiceQName(),
                   registrationInfo.getPortName(),
                   registrationInfo.getServiceUrl(),
                   registrationInfo.getWsdlDefinition());
        serviceLocator.addService(binding.getServiceKey());
      } else {
        log.error("Registration error, due to unsupported registration type of " + registrationInfo.getRegistrationType());
      }
    } catch (Exception e) {
      log.error("Not able to register " + registrationInfo.getRegistrationType()
View Full Code Here


      if (result == null)
        Assert.fail("Null result from find binding operation");
      List<BindingTemplate> btList = result.getBindingTemplate();
      if (btList == null || btList.size() == 0)
        Assert.fail("No result from find binding operation");
      BindingTemplate btOut = btList.get(0);
     
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(TckBindingTemplate.JOE_BINDING_XML, "org.uddi.api_v3");
     
      assertEquals(btIn.getServiceKey(), btOut.getServiceKey());
      assertEquals(btIn.getBindingKey(), btOut.getBindingKey());
     
      TckValidator.checkDescriptions(btIn.getDescription(), btOut.getDescription());
      TckValidator.checkCategories(btIn.getCategoryBag(), btOut.getCategoryBag());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown:  " + e.getMessage());
    }
View Full Code Here

        bsIn.setServiceKey(serviceKey + "-" + businessInt + "-" + i);
        bsIn.getBindingTemplates().getBindingTemplate().get(0).setBindingKey(bindingKey + "-" + businessInt + "-" + i);
        bsIn.getBindingTemplates().getBindingTemplate().get(0).setServiceKey(serviceKey + "-" + businessInt + "-" + i);
        ss.getBusinessService().add(bsIn);
       
        BindingTemplate bt = bsIn.getBindingTemplates().getBindingTemplate().get(0);
        if (! bt.getServiceKey().equals(serviceKey + "-" + businessInt + "-" + i)) {
          System.out.println("not the same");
        }
       
        publication.saveService(ss);
        logger.debug("Add service with key " + bsIn.getServiceKey());
View Full Code Here

  /**
   * Copies the TemplateBinding from one UDDI to another UDDI.
   */
  public void xRegisterServiceBinding() {
    try {
      BindingTemplate bindingTemplate = fromClerk.findServiceBinding(entityKey,fromClerk.getUDDINode().getApiNode());
      log.info("xregister binding " + bindingTemplate.getBindingKey()+ " + from "
          + fromClerk.getName() + " to " + toClerk.getName());
      toClerk.register(bindingTemplate,toClerk.getUDDINode().getApiNode());
    } catch (Exception e) {
      log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e);
    }
View Full Code Here

              System.out.println("Service Key         = '" + businessService.getServiceKey() + "'");
              System.out.println("Service Description = '" + businessService.getDescription().get(0).getValue() + "'");
              System.out.println("BindingTemplates: " + businessService.getBindingTemplates().getBindingTemplate().size());
             
              for (int i=0; i<businessService.getBindingTemplates().getBindingTemplate().size(); i++) {
              BindingTemplate bindingTemplate = businessService.getBindingTemplates().getBindingTemplate().get(i);
              System.out.println("--BindingTemplate" + " " + i + ":");
              System.out.println("  bindingKey          = " + bindingTemplate.getBindingKey());
              System.out.println("  accessPoint useType = " + bindingTemplate.getAccessPoint().getUseType());
              System.out.println("  accessPoint value   = " + bindingTemplate.getAccessPoint().getValue());
              System.out.println("  description         = " + bindingTemplate.getDescription().get(0).getValue());
              }
            }
          }
             
          businessEntity.getBusinessServices();
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) {

        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 = address.getLocationURI();
                        }
                        else if (element instanceof HTTPAddress) {
                          HTTPAddress address = (HTTPAddress) element;
                            location = address.getLocationURI();
                        }
                        else if (element instanceof SOAP12Address) {
                          SOAP12Address address = (SOAP12Address) element;
                            location = 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();
                }
                Description description = new Description();
                description.setLang(lang);
                description.setValue(bindingDescription);
                bindingTemplate.getDescription().add(description);

                // reference wsdl:binding tModel
                TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
                tModelInstanceInfoBinding.setTModelKey(keyDomainURI + binding.getQName().getLocalPart());
                InstanceDetails instanceDetails = new InstanceDetails();
                instanceDetails.setInstanceParms(portName);
                tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);
                Description descriptionB = new Description();
                descriptionB.setLang(lang);
                descriptionB.setValue("The wsdl:binding that this wsdl:port implements. " + bindingDescription
                        + " The instanceParms specifies the port local name.");
                tModelInstanceInfoBinding.getDescription().add(descriptionB);
                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();
                }
                Description descriptionPT = new Description();
                descriptionPT.setLang(lang);
                descriptionPT.setValue("The wsdl:portType that this wsdl:port implements." + portTypeDescription);
                tModelInstanceInfoPortType.getDescription().add(descriptionPT);
                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

   * Register a BindingTemplate.
   *
   */
  public BindingTemplate register(BindingTemplate binding, Node node) {
   
    BindingTemplate bindingTemplate=null;
    log.info("Registering bindingTemplate with key " + binding.getBindingKey());
    try {
      String authToken = getAuthToken(node.getSecurityUrl());
      SaveBinding saveBinding = new SaveBinding();
      saveBinding.setAuthInfo(authToken);
      saveBinding.getBindingTemplate().add(binding);
      BindingDetail bindingDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBinding(saveBinding);
      bindingTemplate = bindingDetail.getBindingTemplate().get(0);
      if (log.isDebugEnabled()) log.debug("Registering template binding " + binding.getBindingKey() + " completed.");
    } catch (Exception e) {
      log.error("Unable to register template binding " + bindingTemplate.getBindingKey()
          + " ." + e.getMessage(),e);
    } catch (Throwable t) {
      log.error("Unable to register template binding " + bindingTemplate.getBindingKey()
          + " ." + t.getMessage(),t);
    }
    return bindingTemplate;
  }
View Full Code Here

        CategoryBag categoryBag = parseCategoryBag(uddiService.categoryBag());
            service.setCategoryBag(categoryBag);
      }
     
      //bindingTemplate on service
      BindingTemplate bindingTemplate = parseServiceBinding(clazz, lang, webServiceAnnotation, properties);
      if (bindingTemplate!=null) {
        bindingTemplate.setServiceKey(service.getServiceKey());
        if (service.getBindingTemplates()==null) {
          service.setBindingTemplates(new BindingTemplates());
        }
        service.getBindingTemplates().getBindingTemplate().add(bindingTemplate);
      }
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.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.