コード例 #1
0
  public void deleteBusiness(String authToken, String businessName)
      throws TransportException, DispositionReportFaultMessage, RemoteException {

    UDDIInquiryPortType uddiInquiryService = transport.getUDDIInquiryService();

    Name name = new Name();
    name.setValue(businessName);

    FindBusiness fb = new FindBusiness();
    fb.setAuthInfo(authToken);
    fb.getName().add(name);
    fb.setMaxRows(999);

    BusinessList foundBusinesses = uddiInquiryService.findBusiness(fb);

    if (foundBusinesses.getBusinessInfos() != null) {
      for (BusinessInfo business : foundBusinesses.getBusinessInfos().getBusinessInfo()) {
        System.out.println(
            "delete business: " + business.getName() + " - " + business.getBusinessKey());
        org.uddi.api_v3.DeleteBusiness db = new org.uddi.api_v3.DeleteBusiness();
        db.setAuthInfo(authToken);
        db.getBusinessKey().add(business.getBusinessKey());
        transport.getUDDIPublishService().deleteBusiness(db);
      }
    } else {
      System.out.println("didn't found any business");
    }
  }
コード例 #2
0
  @BeforeClass
  public static void startManager() throws ConfigurationException {
    if (!TckPublisher.isEnabled()) return;
    logger.info("UDDI_142_DigitalSignatureIntegrationTests");
    manager = new UDDIClient();
    manager.start();

    logger.debug("Getting auth tokens..");
    try {
      Transport transport = manager.getTransport("uddiv3");
      security = transport.getUDDISecurityService();

      publicationJoe = transport.getUDDIPublishService();
      inquiryJoe = transport.getUDDIInquiryService();

      subscriptionJoe = transport.getUDDISubscriptionService();

      authInfoJoe =
          TckSecurity.getAuthToken(
              security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
      authInfoSam =
          TckSecurity.getAuthToken(
              security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
      // Assert.assertNotNull(authInfoJoe);
      // Assert.assertNotNull(authInfoSam);
      if (!TckPublisher.isUDDIAuthMode()) {
        TckSecurity.setCredentials(
            (BindingProvider) publicationJoe,
            TckPublisher.getJoePublisherId(),
            TckPublisher.getJoePassword());
        TckSecurity.setCredentials(
            (BindingProvider) inquiryJoe,
            TckPublisher.getJoePublisherId(),
            TckPublisher.getJoePassword());
        TckSecurity.setCredentials(
            (BindingProvider) subscriptionJoe,
            TckPublisher.getJoePublisherId(),
            TckPublisher.getJoePassword());
      }
      tckTModelJoe = new TckTModel(publicationJoe, inquiryJoe);
      tckBusinessJoe = new TckBusiness(publicationJoe, inquiryJoe);

      transport = manager.getTransport("uddiv3");

      publicationSam = transport.getUDDIPublishService();
      inquiryJoeSam = transport.getUDDIInquiryService();
      if (!TckPublisher.isUDDIAuthMode()) {
        TckSecurity.setCredentials(
            (BindingProvider) publicationSam,
            TckPublisher.getSamPublisherId(),
            TckPublisher.getSamPassword());
        TckSecurity.setCredentials(
            (BindingProvider) inquiryJoeSam,
            TckPublisher.getSamPublisherId(),
            TckPublisher.getSamPassword());
        TckSecurity.setCredentials(
            (BindingProvider) subscriptionSam,
            TckPublisher.getJoePublisherId(),
            TckPublisher.getJoePassword());
      }
      subscriptionSam = transport.getUDDISubscriptionService();
      tckTModelSam = new TckTModel(publicationSam, inquiryJoeSam);
      tckBusinessSam = new TckBusiness(publicationSam, inquiryJoeSam);

    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("Could not obtain authInfo token.");
    }
    JUDDI_300_MultiNodeIntegrationTest.testSetupReplicationConfig();
  }