Package org.apache.juddi.v3.client.mapping.wsdl

Examples of org.apache.juddi.v3.client.mapping.wsdl.WSDL2UDDI


        }

        @Test
        public void test_3_2_2_UDDI_binding_tModel() throws WSDLException, JAXBException, IOException, ConfigurationException {

                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
                @SuppressWarnings("unchecked")
                Map<QName, Binding> bindings = (Map<QName, Binding>) wsdlDefinition.getAllBindings();
                Set<TModel> tModels = wsdl2UDDI.createWSDLBindingTModels(wsdlURL, bindings);

                //Now check
                Assert.assertEquals(1, tModels.size());

                TModel tModel = tModels.iterator().next();
View Full Code Here


                }
        }

        @Test
        public void test_3_2_3_UDDI_businessService_and_bindingTemplate() throws JAXBException, IOException, ConfigurationException {
                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);

                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
                PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();

                Assert.assertEquals(1, businessServices.getBusinessService().size());

                BusinessService businessService = businessServices.getBusinessService().get(0);
View Full Code Here

        }

        @Test
        public void test_3_2_3_UDDI_businessService_and_bindingTemplateLongDescriptions() throws JAXBException, IOException, ConfigurationException {
                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);

                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinitionLongDescriptions);
                PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();

                Assert.assertEquals(1, businessServices.getBusinessService().size());

                BusinessService businessService = businessServices.getBusinessService().get(0);
View Full Code Here

      Definition wsdlDefinition = new ReadWSDL().readWSDL("wsdl/sample.wsdl");
      //set required properties
      properties.put("keyDomain", "uddi.joepublisher.com");
      properties.put(org.apache.juddi.v3.client.config.Property.BUSINESS_KEY, "uddi:uddi.joepublisher.com:businessone");
      properties.put("nodeName", "api.example.org_80");
      WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(clerk, urlLocalizer, properties);
      //register all services in the wsdl
      wsdl2UDDI.registerBusinessServices(wsdlDefinition);
      //done
     
      String portTypeName = "StockQuotePortType";
      String namespace    = "http://example.com/stockquote/";
      FindTModel findTModelForPortType = WSDL2UDDI.createFindPortTypeTModelForPortType(portTypeName, namespace);
      System.out.println(new PrintUDDI<FindTModel>().print(findTModelForPortType));
     
      wsdl2UDDI.unRegisterBusinessServices(wsdlDefinition);
    } finally {
      tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
      tckTModel.deleteJoePublisherTmodel(authInfoJoe);
    }
  }
View Full Code Here

                properties.put("keyDomain", domain);
                properties.put("businessName", domain);
                properties.put("serverName", domain);
                properties.put("serverPort", port);
                wsdlURL = wsdlDefinition.getDocumentBaseURI();
                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
                @SuppressWarnings("unchecked")
                Map<QName, PortType> portTypes = (Map<QName, PortType>) wsdlDefinition.getAllPortTypes();
                Set<TModel> portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes);
                Map allBindings = wsdlDefinition.getAllBindings();
                Set<TModel> createWSDLBindingTModels = wsdl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings);
        //When parsing a WSDL, there's really two things going on
                //1) convert a bunch of stuff (the portTypes) to tModels
                //2) convert the service definition to a BusinessService

                //Since the service depends on the tModel, we have to save the tModels first
View Full Code Here

    }
    logger.debug("Getting subscriber proxy..");
    try {
           Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
           if (transportClass!=null) {
             Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance("default");
            
             UDDISecurityPortType security = transport.getUDDISecurityService();
             authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.JOE_PUBLISHER_ID, TckPublisher.JOE_PUBLISHER_CRED);
             Assert.assertNotNull(authInfoJoe);
             authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.SAM_SYNDICATOR_ID, TckPublisher.SAM_SYNDICATOR_CRED);
             Assert.assertNotNull(authInfoSam);
            
             publication = transport.getUDDIPublishService();
             UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
             UDDISubscriptionPortType subscription = transport.getUDDISubscriptionService();
            
             tckTModel  = new TckTModel(publication, inquiry);
             tckBusiness = new TckBusiness(publication, inquiry);
             tckBusinessService = new TckBusinessService(publication, inquiry);
             tckSubscriptionListener = new TckSubscriptionListener(subscription, publication)
View Full Code Here

    modelNode.setDescription(node.getDescription());
    try {
      UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(clerk.getManagerName());
      String clazz = manager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
      Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
      Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(clerk.getManagerName(),clerk.getUDDINode().getName())
      String authToken = (String) session.getAttribute("token-" + clerk.getName());

      UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
      List<org.uddi.sub_v3.Subscription> subscriptions = subscriptionService.getSubscriptions(authToken);
      for (org.uddi.sub_v3.Subscription subscription : subscriptions) {
        String expiresAfter = null;
        if (subscription.getExpiresAfter()!=null) expiresAfter = subscription.getExpiresAfter().toString();
        String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(subscription.getSubscriptionFilter()), "org.uddi.sub_v3");
View Full Code Here

          }
        }
      }
     
      logger.info("Updating homeNode server using jUDDI specific API..");
      Transport defaultTransport = WebHelper.getTransport(session.getServletContext());
      JUDDIApiPortType juddiApiService = defaultTransport.getJUDDIApiService();
     
      //making sure our node info is there and up to date.
      SaveNode saveNode = new SaveNode();
      saveNode.setAuthInfo(userAuthToken);
      saveNode.getNode().add(clerk.getApiClerk().getNode());
      juddiApiService.saveNode(saveNode);
      //making sure our clerk info is there and up to date
      SaveClerk saveClerk = new SaveClerk();
      saveClerk.setAuthInfo(userAuthToken);
      saveClerk.getClerk().add(clerk.getApiClerk());
      juddiApiService.saveClerk(saveClerk);
      //making sure our node info is there and up to date.
      SaveNode saveToNode = new SaveNode();
      saveToNode.setAuthInfo(userAuthToken);
      saveToNode.getNode().add(toClerk.getApiClerk().getNode());
      juddiApiService.saveNode(saveToNode);
      //making sure our clerk info is there and up to date
      SaveClerk saveToClerk = new SaveClerk();
      saveToClerk.setAuthInfo(userAuthToken);
      saveToClerk.getClerk().add(toClerk.getApiClerk());
      juddiApiService.saveClerk(saveToClerk);
      logger.debug("Updating default UDDI server completed.");
     
      SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
      saveClientSubscriptionInfo.setAuthInfo(userAuthToken);
      ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
      clientSubscriptionInfo.setSubscriptionKey(modelSubscription.getSubscriptionKey());
      clientSubscriptionInfo.setFromClerk(clerk.getApiClerk());
      clientSubscriptionInfo.setToClerk(toClerk.getApiClerk());
     
      saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
      //save clientSubscription to the listening UDDI default server.
      juddiApiService.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
      logger.debug("Saved ClientSubscriptionInfo to the default UDDI server");
     
      //the listening server is ready; now add the subscription
      Transport transport = WebHelper.getTransport(session.getServletContext(), clerk.getUDDINode());
      UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
      List<org.uddi.sub_v3.Subscription> subscriptionList = new ArrayList<org.uddi.sub_v3.Subscription>();
      org.uddi.sub_v3.Subscription subscription = new org.uddi.sub_v3.Subscription();
      if (!"".equals(modelSubscription.getBindingKey())) {
        subscription.setBindingKey(modelSubscription.getBindingKey());
      }
View Full Code Here

    try {
   
      try {
        UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
        UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
        Transport transport = WebHelper.getTransport(session.getServletContext(), clerk.getUDDINode());
        UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
        DeleteSubscription deleteSubscription = new DeleteSubscription();
        String authToken = (String) session.getAttribute("token-" + clerk.getName());
        deleteSubscription.setAuthInfo(authToken);
        deleteSubscription.getSubscriptionKey().add(modelSubscription.getSubscriptionKey());
        subscriptionService.deleteSubscription(deleteSubscription);
        logger.info("Deleted Subscription " + modelSubscription.getSubscriptionKey()
            + " from UDDI server " + clerk.getUDDINode().getName());
      } catch (Exception e) {
        error = "Could not delete subscription. Reason: " + e.getMessage();
        logger.error(error, e);
      }
      try {
        //now remove it from the listener UDDI server too
        Transport transport = WebHelper.getTransport(session.getServletContext());
        JUDDIApiPortType juddiApiService = transport.getJUDDIApiService();
       
        DeleteClientSubscriptionInfo deleteClientSubscriptionInfo = new DeleteClientSubscriptionInfo();
        deleteClientSubscriptionInfo.setAuthInfo(userAuthToken);
        deleteClientSubscriptionInfo.getSubscriptionKey().add(modelSubscription.getSubscriptionKey());
        //remove the clientSubscription to the listening UDDI default server.
View Full Code Here

      String authToken = (String) session.getAttribute("token-" + modelSubscription.getFromClerkName());
      getSubscriptionResults.setAuthInfo(authToken);
            SyncSubscription syncSubscription = new SyncSubscription();
            syncSubscription.getGetSubscriptionResultsList().add(getSubscriptionResults);
     
          Transport transport = WebHelper.getTransport(session.getServletContext());
             JUDDIApiPortType apiService = transport.getJUDDIApiService();
     
             syncSubscription.setAuthInfo(userAuthToken);
             SyncSubscriptionDetail detail = apiService.invokeSyncSubscription(syncSubscription);
      SubscriptionResultsList list = detail.getSubscriptionResultsList().get(0);
      System.out.println("list=" + list);
View Full Code Here

TOP

Related Classes of org.apache.juddi.v3.client.mapping.wsdl.WSDL2UDDI

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.