Package org.uddi4j.datatype.binding

Examples of org.uddi4j.datatype.binding.BindingTemplate


          TModel tModel = null;

          if (uddiReference.getKeyType().equals(UDDIReference.BINDING_KEY)) {
              BindingDetail bindingDetail = uddiProxy.get_bindingDetail(
                      uddiReference.getKey());
              BindingTemplate bindingTemplate = (BindingTemplate) bindingDetail.
                      getBindingTemplateVector().elementAt(0);
              tModel = UDDIUtils.findTModel(uddiProxy, bindingTemplate, false);
          } else { // UDDIReference.TMODEL_KEY
              TModelDetail tModelDetail = uddiProxy.get_tModelDetail(
                          uddiReference.getKey());
View Full Code Here


    String serviceLocation = null;

    result = AssertionResult.RESULT_PASSED;

    // Get the bindingTemplate from the entryContext
    BindingTemplate bindingTemplate =
      (BindingTemplate) entryContext.getEntry().getEntryDetail();

    // If the bindingTemplate does not contain an accessPoint, then fail
    if ((bindingTemplate.getAccessPoint() == null)
      || ((serviceLocation = bindingTemplate.getAccessPoint().getText())
        == null))
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage =
        "The bindingTempate key is: ["
          + bindingTemplate.getBindingKey()
          + "].";
    }

    // Else save the service location in the assertion result
    else
View Full Code Here

    throws WSIException
  {
    result = AssertionResult.RESULT_PASSED;

    // Get the bindingTemplate from the entryContext
    BindingTemplate bindingTemplate =
      (BindingTemplate) entryContext.getEntry().getEntryDetail();

    boolean validService = false;
    boolean validBusiness = false;

    String serviceKey = null;
    String businessKey = null;
    try
    {
      serviceKey = bindingTemplate.getServiceKey();
      BusinessService service =
        UDDIUtils.getBusinessServiceByKey(this.validator.uddiProxy, serviceKey);

      businessKey = service.getBusinessKey();
      BusinessEntity business =
View Full Code Here

   */
  public void validateArtifact() throws WSIException
  {
    Entry entry = null;

    BindingTemplate bindingTemplate = null;
    TModel tModel = null;

    // it depricated after refactoring
    // now the inner classes moved out from validator
    //String classPrefix = this.getClass().getName() + "$";
    String classPrefix = this.getClass().getPackage().getName()+".";

    try
    {
      // Set up a reference to the UDDI registry
      uddiProxy = new UDDIProxy();

      //new Socket(new InetAddress(uddiReference.getInquiryURL()));
      uddiProxy.setInquiryURL(uddiReference.getInquiryURL());
      boolean wasEx = false;
      InputStream stream;
      try
      {
        URL url = StringUtils.getURL(null, uddiReference.getInquiryURL());
        stream = url.openStream();
        stream.close();
      }

      catch (UnknownHostException ex)
      {
        wasEx = true;
      }

      catch (IOException ex)
      {
      }

      if (!wasEx)
      {

        // If the UDDI reference is to a bindingTemplate then get it
        if (uddiReference.getKeyType().equals(UDDIReference.BINDING_KEY))
        {
          // Get binding detail which will contain the bindingTemplate
          BindingDetail bindingDetail =
            uddiProxy.get_bindingDetail(uddiReference.getKey());

          // Get bindingTemplate
          bindingTemplate =
            (BindingTemplate) bindingDetail
              .getBindingTemplateVector()
              .elementAt(
              0);

          if (verboseOption)
          {
            System.err.println(
              "    BindingTemplate - "
                + UDDIUtils.bindingTemplateToString(bindingTemplate));
          }

          // Get the wsdlSpec tModel
          tModel = UDDIUtils.findTModel(uddiProxy, bindingTemplate,
                  verboseOption);
        }

        // Else it has to be a tModel
        else
        {
          TModelDetail tModelDetail =
            uddiProxy.get_tModelDetail(uddiReference.getKey());
          tModel = (TModel) tModelDetail.getTModelVector().elementAt(0);
        }

        if (verboseOption)
        {
          System.err.println(
            "    TModel specified or found in bindingTemplate - "
              + UDDIUtils.tModelToString(tModel));
        }
      }

      if (bindingTemplate == null)
      {
        setMissingInput(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
      }

      // If there is a bindingTemplate, then process test assertions for it
      else
      {
        // Create entry
        entry = this.reporter.getReport().createEntry();
        entry.setEntryType(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
        entry.setReferenceID(bindingTemplate.getBindingKey());
        entry.setEntryDetail(bindingTemplate);

        // Process test assertions
        processAssertions(
          classPrefix,
View Full Code Here

    busService.setBusinessKey(_animalBusinessEntity.getBusinessKey());
    Name name = new Name(ANIMAL_BUSINESS_SERVICE);
    busService.setDefaultName(name);
    CategoryBag catBag = _createCategoryBag();
    busService.setCategoryBag(catBag);
    BindingTemplate bindingTemplate = new BindingTemplate();
    TModelInstanceDetails tModelInstanceDetails = new TModelInstanceDetails();
    TModelInstanceInfo tModelInstanceInfo = new TModelInstanceInfo();
    tModelInstanceInfo.setTModelKey(((TModel)_animalProtocol_tModelDetail.getTModelVector().elementAt(0)).getTModelKey());
    tModelInstanceInfo.setDefaultDescriptionString("Animal Protocol tModel Instance");
    tModelInstanceDetails.add(tModelInstanceInfo);

    tModelInstanceInfo = new TModelInstanceInfo();
    tModelInstanceInfo.setTModelKey(((TModel)_animalProtocol_tModelDetail.getTModelVector().elementAt(0)).getTModelKey());

    /**
     * This creates the unique, well-defined tModel representing the service's WSDL
     */
    TModelDetail tmodelDetail = null;
    try {
      tmodelDetail = _publishWSDL_tModel();
    }
    catch (TransportException ex) {
      /**
       * @todo cleanup ??
       */
      return  ret;
    }
    catch (UDDIException ex) {
      /**
       * @todo cleanup ??
       */
      return ret;
    }
    tModelInstanceInfo = new TModelInstanceInfo();
    tModelInstanceInfo.setTModelKey(((TModel)tmodelDetail.getTModelVector().elementAt(0)).getTModelKey());
    tModelInstanceInfo.setDefaultDescriptionString("Animal Service tModel instance");
    tModelInstanceDetails.add(tModelInstanceInfo);

    /**
     * Associate the set of tModels with the Service's BindingTemplate
     */
    bindingTemplate.setTModelInstanceDetails(tModelInstanceDetails);

    /**
     * The binding template needs an [ accessPoint | hostRedirector ]
     */
    AccessPoint animalAccessPoint = _createAccessPoint(ANIMAL_WSDL_URL.substring(0,ANIMAL_WSDL_URL.lastIndexOf("?")));
    bindingTemplate.setAccessPoint(animalAccessPoint);
    BindingTemplates bindingTemplates = new BindingTemplates();

    bindingTemplate.setDefaultDescriptionString("SOAP Binding");
    bindingTemplates.add(bindingTemplate);

    busService.setBindingTemplates(bindingTemplates);

    // save the service
View Full Code Here

  public void tearDown() {

  }

  protected void _simpleBinding() {
    BindingTemplate bindingTemplate = new BindingTemplate();
    bindingTemplate.setDefaultDescriptionString("SOAP Binding");
    bindingTemplate.setServiceKey(_businessService.getServiceKey());
    try {

      AuthToken _bindingToken = proxy.get_authToken("saveBindingPublisher", "password");
      Vector bindingVector = new Vector();
      bindingVector.addElement(bindingTemplate);
View Full Code Here

TOP

Related Classes of org.uddi4j.datatype.binding.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.