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

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


                try {

                        // Now get the entity and check the values
                        GetBusinessDetail gb = new GetBusinessDetail();
                        gb.getBusinessKey().add(businessKey);
                        BusinessDetail bd = inquiry.getBusinessDetail(gb);
                        List<BusinessEntity> beOutList = bd.getBusinessEntity();
                        BusinessEntity beOut = beOutList.get(0);
                        //We are expecting 2 services
                        assertEquals(2, beOut.getBusinessServices().getBusinessService().size());

                        //Now updating the business by adding another description
                        SaveBusiness sb = new SaveBusiness();
                        sb.setAuthInfo(authInfo);
                        BusinessEntity beIn = beOut;
                        Description desc2 = new Description();
                        desc2.setLang("nl");
                        desc2.setValue("Omschrijving");
                        beIn.getDescription().add(desc2);
                        sb.getBusinessEntity().add(beIn);
                        publication.saveBusiness(sb);

                        // Now get the entity and check the values
                        BusinessDetail bdnew = inquiry.getBusinessDetail(gb);
                        List<BusinessEntity> beOutListNew = bdnew.getBusinessEntity();
                        BusinessEntity beOutNew = beOutListNew.get(0);

                        assertEquals(beIn.getBusinessKey(), beOutNew.getBusinessKey());
                        // After the update we still are supposed to see two services.
                        assertNotNull(beOutNew.getBusinessServices());
View Full Code Here


     
      SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
      if (result == null)
        Assert.fail("Null result from getSubscriptionResults operation");

      BusinessDetail busDetail = result.getBusinessDetail();
      if (busDetail == null)
        Assert.fail("No result from getSubscriptionResults operation");
      List<BusinessEntity> beList = busDetail.getBusinessEntity();
      if (beList == null || beList.size() == 0)
        Assert.fail("No result from getSubscriptionResults operation");
      BusinessEntity beOut = beList.get(0);
     
      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.SAM_BUSINESS_XML, "org.uddi.api_v3");
View Full Code Here

        private boolean BusinessExists(String businessKey, String token) {
                GetBusinessDetail r = new GetBusinessDetail();
                r.setAuthInfo(token);
                r.getBusinessKey().add(businessKey);
                try {
                        BusinessDetail tModelDetail = inquiry.getBusinessDetail(r);
                        if (tModelDetail != null && !tModelDetail.getBusinessEntity().isEmpty()) {
                                return true;
                        }
                } catch (Exception ex) {
                }
                return false;
View Full Code Here

                throw new UnexpectedObjectException();
            }
        }
        log.debug("Method:save_business: ENlength=" + entityarr.length);
        // Save business
        BusinessDetail bd = null;
        try {
            bd = (BusinessDetail) executeOperation(entityarr, "SAVE_ORG");
        }
        catch (RegistryV3Exception e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<BusinessEntity> bizEntityList = bd.getBusinessEntity();
       
        entityarr = new BusinessEntity[bizEntityList.size()];
        bizEntityList.toArray(entityarr);
       
        log.debug("After Saving Business. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
View Full Code Here

    if (businessKeyArray != null) {
      request.getBusinessKey().addAll(Arrays.asList(businessKeyArray));
    }

        BusinessDetail bd = null;
        JAXBElement<?> o = execute(this.objectFactory.createGetBusinessDetail(request),
            this.getInquiryURI());
        bd = (BusinessDetail) o.getValue();
        return bd;
  }
View Full Code Here

      }

      request.getBusinessEntity().addAll(Arrays.asList(businessArray));
    }
   
        BusinessDetail bd = null;
        JAXBElement<?> o = execute(this.objectFactory.createSaveBusiness(request),
            this.getPublishURI());
        if (o != null) bd = (BusinessDetail) o.getValue();

        return bd;
View Full Code Here

     
      SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
      if (result == null)
        Assert.fail("Null result from getSubscriptionResults operation");

      BusinessDetail busDetail = result.getBusinessDetail();
      if (busDetail == null)
        Assert.fail("No result from getSubscriptionResults operation");
      List<BusinessEntity> beList = busDetail.getBusinessEntity();
      if (beList == null || beList.size() == 0)
        Assert.fail("No result from getSubscriptionResults operation");
      BusinessEntity beOut = beList.get(0);
     
      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.SAM_BUSINESS_XML, "org.uddi.api_v3");
View Full Code Here

  public void getNonExitingBusiness() {
    String nonExistingKey = "nonexistingKey";
    try {
      GetBusinessDetail body = new GetBusinessDetail();
      body.getBusinessKey().add(nonExistingKey);
      BusinessDetail  result = inquiry.getBusinessDetail(body);
      Assert.fail("No business should be found");
      System.out.println(result.getBusinessEntity().size());
    } catch (Exception e) {
      try {
        DispositionReport report = DispositionReportFaultMessage.getDispositionReport(e);
        assertNotNull(report);
        assertTrue(report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED));
View Full Code Here

      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      ValidatePublish validator = new ValidatePublish(publisher);
      validator.validateSaveBusiness(em, body, null);
 
      BusinessDetail result = new BusinessDetail();
     
      List<org.uddi.api_v3.BusinessEntity> apiBusinessEntityList = body.getBusinessEntity();
      for (org.uddi.api_v3.BusinessEntity apiBusinessEntity : apiBusinessEntityList) {
       
        org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
       
        MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
       
        setOperationalInfo(em, modelBusinessEntity, publisher);
 
        em.persist(modelBusinessEntity);
 
        result.getBusinessEntity().add(apiBusinessEntity);
      }
     
      //check how many business this publisher owns.
      validator.validateSaveBusinessMax(em);
 
View Full Code Here

        GetBusinessDetail gbd = new GetBusinessDetail();
        gbd.setAuthInfo(token);
        for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
            gbd.getBusinessKey().add(businessInfos.getBusinessInfo().get(i).getBusinessKey());
        }
        BusinessDetail businessDetail = inquiry.getBusinessDetail(gbd);
        for (int i = 0; i < businessDetail.getBusinessEntity().size(); i++) {
            System.out.println("Business Detail - key: " + businessDetail.getBusinessEntity().get(i).getBusinessKey());
            System.out.println("Name: " + ListToString(businessDetail.getBusinessEntity().get(i).getName()));
            System.out.println("CategoryBag: " + CatBagToString(businessDetail.getBusinessEntity().get(i).getCategoryBag()));
            PrintContacts(businessDetail.getBusinessEntity().get(i).getContacts());
        }
    }
View Full Code Here

TOP

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

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.