Package org.uddi.api_v3

Examples of org.uddi.api_v3.BindingTemplate


                ss.setAuthInfo(authInfoJoe);
                BusinessService bs = new BusinessService();
                bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
                bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
                bs.setBindingTemplates(new BindingTemplates());
                BindingTemplate bt = new BindingTemplate();
                bt.setBindingKey(TckBusinessService.JOE_BINDING_KEY_1);
                bt.setServiceKey(null);
                bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));

                bs.getName().add(new Name("Joe's bs", null));
                DigSigUtil ds = GetDigSig();
                bt = ds.signUddiEntity(bt);
                bs.getBindingTemplates().getBindingTemplate().add(bt);
View Full Code Here


                ss.setAuthInfo(authInfoJoe);
                BusinessService bs = new BusinessService();
                bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
                bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
                bs.setBindingTemplates(new BindingTemplates());
                BindingTemplate bt = new BindingTemplate();
                bt.setBindingKey(null);
                bt.setServiceKey(null);
                bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));

                bs.getName().add(new Name("Joe's bs", null));
                DigSigUtil ds = GetDigSig();
                bt = ds.signUddiEntity(bt);
                bs.getBindingTemplates().getBindingTemplate().add(bt);
View Full Code Here

                ss.setAuthInfo(authInfoJoe);
                BusinessService bs = new BusinessService();
                bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
                bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
                bs.setBindingTemplates(new BindingTemplates());
                BindingTemplate bt = new BindingTemplate();
                bt.setBindingKey(null);
                bt.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
                bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));

                bs.getName().add(new Name("Joe's bs", null));
                DigSigUtil ds = GetDigSig();
                bt = ds.signUddiEntity(bt);
                bs.getBindingTemplates().getBindingTemplate().add(bt);
View Full Code Here

    @Test
    public void testSignBinding() throws CertificateException {
        Default();
        System.out.println("testSignBinding signing");
        BindingTemplate be = new BindingTemplate();
        be.setBindingKey("uddi:juddi.apache.org:testkey");

        be.getDescription().add(new Description("a description", "en"));


        BindingTemplate signUDDI_JAXBObject = ds.signUddiEntity(be);
        Assert.assertNotSame("items are the same", be, signUDDI_JAXBObject);
        //System.out.println("verifing");
        AtomicReference<String> msg = new AtomicReference<String>();
        boolean verifySigned_UDDI_JAXB_Object = ds.verifySignedUddiEntity(signUDDI_JAXBObject, msg);
        if (verifySigned_UDDI_JAXB_Object) {
            //System.out.println("signature validation passed (expected)");
        } else {
            System.out.println("signature validation failed (not expected)");
            Assert.fail(msg.get());
        }
        validAllSignatureElementsArePresent(signUDDI_JAXBObject.getSignature());
    }
View Full Code Here

                        Assert.fail("unexpected failure " + ex.getMessage() + ex.toString());
                }

                bs = saveService.getBusinessService().get(0);
                bs.setBindingTemplates(new BindingTemplates());
                BindingTemplate bt = new BindingTemplate();
                bt.setBindingKey(null);
                bt.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
                bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));

                bs.getName().add(new Name("Joe's bs", null));
                DigSigUtil ds = GetDigSig();
                bt = ds.signUddiEntity(bt);
                bs.getBindingTemplates().getBindingTemplate().add(bt);
View Full Code Here

                        throw new SecurityException("unable to start endpoint, view previous errors for reason");
                }

                log.info("Endpoint started at " + callback);

                BindingTemplate bt = new BindingTemplate();
                bt.setAccessPoint(new AccessPoint());
                bt.getAccessPoint().setValue(callback);
                bt.getAccessPoint().setUseType("endPoint");
                TModelInstanceInfo instanceInfo = new TModelInstanceInfo();
                instanceInfo.setTModelKey("uddi:uddi.org:transport:http");
                bt.setTModelInstanceDetails(new TModelInstanceDetails());
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(instanceInfo);
                bt.setServiceKey(serviceKey);
                if (keydomain.endsWith(":")) {
                        bt.setBindingKey(keydomain + GetHostname() + "_subscription_callback");
                } else {
                        bt.setBindingKey(keydomain + ":" + GetHostname() + "_subscription_callback");
                }

                if (autoregister) {
                        bt = registerBinding(client, cfg_node_name, bt, behavior);
                }
View Full Code Here

   @Test
     public void testReadingServiceBindingAnnotation() {
       try {
        Class<?> classWithAnnotations = ClassUtil.forName(HelloWorldMockup.class.getName(), this.getClass());
        AnnotationProcessor ap = new AnnotationProcessor();
        BindingTemplate bindingTemplate = ap.parseServiceBinding(classWithAnnotations, "en", null, null);
        assertNotNull(bindingTemplate);
        //expecting references to two keys
        assertEquals(2, bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().size());
        assertEquals("tModelKey1",bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getTModelKey());
        //expecting two KeyedReferences in the CategoryBag
        assertEquals(2, bindingTemplate.getCategoryBag().getKeyedReference().size());
        KeyedReference keyedReference2 = bindingTemplate.getCategoryBag().getKeyedReference().get(1);
       assertEquals("uddi-org:types:wsdl2",keyedReference2.getKeyName());
       assertEquals("wsdlDeployment2",keyedReference2.getKeyValue());
       assertEquals("uddi:uddi.org:categorization:types2",keyedReference2.getTModelKey());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
View Full Code Here

         properties.put("serverPort", "8080");
         BusinessService service = ap.readServiceAnnotations(HelloWorldMockup2.class.getName(),properties);
         assertNotNull(service);
         assertEquals("HelloWorldMockup2",service.getName().get(0).getValue());
         assertEquals(1,service.getBindingTemplates().getBindingTemplate().size());
         BindingTemplate binding = service.getBindingTemplates().getBindingTemplate().get(0);
         String endPoint = binding.getAccessPoint().getValue();
         assertEquals("http://localhost:8080/subscription-listener/helloworld",endPoint);
         String serviceKey = binding.getServiceKey();
         assertEquals(service.getServiceKey(),serviceKey);
         assertNull(service.getCategoryBag());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
           e.printStackTrace();
View Full Code Here

    try {
      // First save the entity
      SaveBinding sb = new SaveBinding();
      sb.setAuthInfo(authInfo);
     
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(bindingXML, "org.uddi.api_v3");
      sb.getBindingTemplate().add(btIn);
      publication.saveBinding(sb);
     
      // Now get the entity and check the values
      GetBindingDetail gb = new GetBindingDetail();
      gb.getBindingKey().add(bindingKey);
      BindingDetail bd = inquiry.getBindingDetail(gb);
      List<BindingTemplate> btOutList = bd.getBindingTemplate();
      BindingTemplate btOut = btOutList.get(0);

      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

        Iterator iter = bindings.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                BindingTemplate bs = ScoutJaxrUddiV3Helper.getBindingTemplateFromJAXRSB((ServiceBinding) iter.next());
                sbarr[currLoc] = bs;
                currLoc++;
            }
            catch (ClassCastException ce) {
                throw new UnexpectedObjectException();
            }
        }
        // Save ServiceBinding
        BindingDetail bd = null;
        try {
            bd = (BindingDetail) executeOperation(sbarr, "SAVE_SERVICE_BINDING");
        }
        catch (RegistryV3Exception e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<BindingTemplate> bindingTemplateList = bd.getBindingTemplate();
        sbarr = new BindingTemplate[bindingTemplateList.size()];
        bindingTemplateList.toArray(sbarr);
       
        for (int i = 0; sbarr != null && i < sbarr.length; i++) {
            BindingTemplate bt = (BindingTemplate) sbarr[i];
            coll.add(new KeyImpl(bt.getBindingKey()));
        }
        if (coll.size()>0) {
            bulk.setCollection(coll);
        }
        bulk.setExceptions(exceptions);
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.